Skip to content
Extraits de code Groupes Projets
Valider 6156633b rédigé par mattab's avatar mattab
Parcourir les fichiers

Make exception more specific and throw only when site was invalid

parent a20ea9d7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -231,8 +231,11 @@ class Site ...@@ -231,8 +231,11 @@ class Site
*/ */
protected function get($name) 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])) { 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]; return self::$infoSites[$this->id][$name];
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter