Skip to content

Commit

Permalink
Fix exceptions from result iterator too.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed May 24, 2017
1 parent c1021e5 commit 1e1ce3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions framework/Alarm/lib/Horde/Alarm/Sql.php
Expand Up @@ -81,19 +81,18 @@ protected function _list($user, Horde_Date $time)
$values[] = (string)$user;
}

$alarms = array();
try {
$result = $this->_db->select($query, $values);
foreach ($result as $val) {
$alarms[] = $this->_getHash($val);
}
} catch (Horde_Db_Exception $e) {
throw new Horde_Alarm_Exception(
Horde_Alarm_Translation::t("Server error when querying database.")
);
}

$alarms = array();
foreach ($result as $val) {
$alarms[] = $this->_getHash($val);
}

return $alarms;
}

Expand Down
4 changes: 2 additions & 2 deletions framework/Alarm/package.xml
Expand Up @@ -21,7 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Fix catching database backend exceptions.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -1026,7 +1026,7 @@
<date>2017-05-03</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Fix catching database backend exceptions.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 1e1ce3b

Please sign in to comment.