diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-12-16 05:14:11 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-12-16 05:14:11 +0300 |
commit | 6156633bf22de4e336dd459c7f5e10d6f136a33c (patch) | |
tree | 8ac91bf4dc669c82a746ae05ff0204d78c99b39a /core/Site.php | |
parent | a20ea9d76076caf39fe258d2b3080aaa3a00fbf4 (diff) |
Make exception more specific and throw only when site was invalid
Diffstat (limited to 'core/Site.php')
-rw-r--r-- | core/Site.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/Site.php b/core/Site.php index f79a442317..4818590f82 100644 --- a/core/Site.php +++ b/core/Site.php @@ -231,8 +231,11 @@ class Site */ protected function get($name) { + if (!isset(self::$infoSites[$this->id])) { + throw new UnexpectedWebsiteFoundException('The requested website id = ' . (int)$this->id . ' couldn\'t be found'); + } if (!isset(self::$infoSites[$this->id][$name])) { - throw new UnexpectedWebsiteFoundException('The requested website id = ' . (int)$this->id . ' (or its property ' . $name . ') couldn\'t be found'); + throw new Exception("The property $name could not be found on the website ID " . (int)$this->id); } return self::$infoSites[$this->id][$name]; } |