Skip to content

Commit 3520de6

Browse files
cscd98mageprince
authored andcommitted
Add useful debug info for which website has not been found
1 parent 8fdae10 commit 3520de6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

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

7979
if ($website->getId() === null) {
80-
throw new NoSuchEntityException();
80+
throw new NoSuchEntityException(
81+
__(sprintf("The website %s that was requested wasn't found. Verify the website and try again.", $code))
82+
);
8183
}
8284
$this->entities[$code] = $website;
8385
$this->entitiesById[$website->getId()] = $website;
@@ -99,7 +101,9 @@ public function getById($id)
99101
]);
100102

101103
if ($website->getId() === null) {
102-
throw new NoSuchEntityException();
104+
throw new NoSuchEntityException(
105+
__(sprintf("The website %s that was requested wasn't found. Verify the website and try again.", $id))
106+
);
103107
}
104108
$this->entities[$website->getCode()] = $website;
105109
$this->entitiesById[$id] = $website;

0 commit comments

Comments
 (0)