Skip to content

Commit fbefc61

Browse files
committed
Add useful debug info for which website has not been found
1 parent f77f96b commit fbefc61

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
@@ -78,7 +78,9 @@ public function get($code)
7878
]);
7979

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

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

0 commit comments

Comments
 (0)