Skip to content

Commit 5d7e9d2

Browse files
authored
ENGCOM-3945: [Backport] Add useful debug info for which website has not been found #20522
2 parents 401203a + 8e584a3 commit 5d7e9d2

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

app/code/Magento/Store/Model/WebsiteRepository.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@ public function get($code)
7777
]);
7878

7979
if ($website->getId() === null) {
80-
throw new NoSuchEntityException();
80+
throw new NoSuchEntityException(
81+
__(
82+
sprintf(
83+
"The website with code %s that was requested wasn't found. Verify the website and try again.",
84+
$code
85+
)
86+
)
87+
);
8188
}
8289
$this->entities[$code] = $website;
8390
$this->entitiesById[$website->getId()] = $website;
@@ -99,7 +106,14 @@ public function getById($id)
99106
]);
100107

101108
if ($website->getId() === null) {
102-
throw new NoSuchEntityException();
109+
throw new NoSuchEntityException(
110+
__(
111+
sprintf(
112+
"The website with id %s that was requested wasn't found. Verify the website and try again.",
113+
$id
114+
)
115+
)
116+
);
103117
}
104118
$this->entities[$website->getCode()] = $website;
105119
$this->entitiesById[$id] = $website;

0 commit comments

Comments
 (0)