Skip to content

Commit 16b5888

Browse files
ENGCOM-3945: [Backport] Add useful debug info for which website has not been found #20522
- Merge Pull Request #20522 from mageprince/magento2:2.2-develop-PR-port-19709 - Merged commits: 1. 3520de6 2. 3bc62e6
2 parents 8fdae10 + 3bc62e6 commit 16b5888

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 with code %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 with id %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)