Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2014-12-16 05:14:11 +0300
committermattab <matthieu.aubry@gmail.com>2014-12-16 05:14:11 +0300
commit6156633bf22de4e336dd459c7f5e10d6f136a33c (patch)
tree8ac91bf4dc669c82a746ae05ff0204d78c99b39a /core/Site.php
parenta20ea9d76076caf39fe258d2b3080aaa3a00fbf4 (diff)
Make exception more specific and throw only when site was invalid
Diffstat (limited to 'core/Site.php')
-rw-r--r--core/Site.php5
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];
}