From ee54daef352bec0660e295790a4a9066f257ab3c Mon Sep 17 00:00:00 2001 From: Ceeram Date: Mon, 20 Feb 2012 15:41:57 +0100 Subject: [PATCH] AclNode now throws exception instead of trigger_error --- lib/Cake/Model/AclNode.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php index 2cd40c779..277563251 100644 --- a/lib/Cake/Model/AclNode.php +++ b/lib/Cake/Model/AclNode.php @@ -128,8 +128,7 @@ class AclNode extends Model { $model = ClassRegistry::init(array('class' => $name, 'alias' => $alias)); if (empty($model)) { - trigger_error(__d('cake_dev', "Model class '%s' not found in AclNode::node() when trying to bind %s object", $type, $this->alias), E_USER_WARNING); - return null; + throw new CakeException('cake_dev', "Model class '%s' not found in AclNode::node() when trying to bind %s object", $type, $this->alias); } $tmpRef = null; @@ -173,7 +172,7 @@ class AclNode extends Model { $result = $db->read($this, $queryData, -1); if (!$result) { - trigger_error(__d('cake_dev', "AclNode::node() - Couldn't find %s node identified by \"%s\"", $type, print_r($ref, true)), E_USER_WARNING); + throw new CakeException(__d('cake_dev', "AclNode::node() - Couldn't find %s node identified by \"%s\"", $type, print_r($ref, true))); } } return $result;