From 001f9be89da75fd15aec093857458a270499e681 Mon Sep 17 00:00:00 2001 From: uckelman Date: Sun, 11 Apr 2010 19:03:19 +0000 Subject: Converted trigger_error to 'throw new Exception'. git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6669 67b53d14-2c14-4ace-a08f-0dab2b34000c --- src/Bridge.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/Bridge.php') diff --git a/src/Bridge.php b/src/Bridge.php index a4aa77a..05689f8 100644 --- a/src/Bridge.php +++ b/src/Bridge.php @@ -30,11 +30,11 @@ class Bridge { public function setPostId($messageId, $postId) { if ($messageId === null) { - trigger_error('message id is null', E_USER_ERROR); + throw new Exception('message id is null'); } if ($postId === null) { - trigger_error('post id is null', E_USER_ERROR); + throw new Exception('post id is null'); } $sql = 'UPDATE posts SET ' . @@ -44,9 +44,7 @@ class Bridge { $count = $this->db->exec($sql); if ($count != 1) { - trigger_error( - 'Failed to set post id: ' . $messageId, E_USER_ERROR - ); + throw new Exception('Failed to set post id: ' . $messageId); } } @@ -60,7 +58,7 @@ class Bridge { public function registerMessage($messageId, $inReplyTo, $refs) { if ($messageId === null) { - trigger_error('message id is null', E_USER_ERROR); + throw new Exception('message id is null'); } $sql = 'INSERT IGNORE INTO posts ' . @@ -82,14 +80,14 @@ class Bridge { switch (count($rows)) { case 0: - trigger_error("No rows returned: $sql", E_USER_ERROR); + throw new Exception("No rows returned: $sql"); break; case 1: return $rows[0]; default: - trigger_error("Too many rows returned: $sql", E_USER_ERROR); + throw new Exception("Too many rows returned: $sql"); break; } } -- cgit v1.2.3