summaryrefslogtreecommitdiff
path: root/src/Bridge.php
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-04-11 19:03:19 +0000
committeruckelman <uckelman@nomic.net>2010-04-11 19:03:19 +0000
commit001f9be89da75fd15aec093857458a270499e681 (patch)
tree23c78cb1402d8d3dd12c895d318c795fbe01e6dd /src/Bridge.php
parenta9880643f1adebb81112835d665fb8b5b6904491 (diff)
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
Diffstat (limited to 'src/Bridge.php')
-rw-r--r--src/Bridge.php14
1 files changed, 6 insertions, 8 deletions
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;
}
}