Skip to content

Commit 498c345

Browse files
ENGCOM-3671: Add useful debug info for which website has not been found #19709
- Merge Pull Request #19709 from craigcarnell/magento2:logging/websiteRepository - Merged commits: 1. fbefc61 2. 2feed60
2 parents 6a8a6a0 + 2feed60 commit 498c345

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