Skip to content

Commit

Permalink
Use the full exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed May 3, 2017
1 parent a029f39 commit 94c8aa6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions framework/Share/lib/Horde/Share/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected function _getShareUsers(&$share)
try {
$rows = $this->_db->select('SELECT * FROM ' . $this->_table . '_users WHERE share_id = ?', array($share['share_id']));
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}

foreach ($rows as $row) {
Expand All @@ -216,7 +216,7 @@ protected function _getShareGroups(&$share)
try {
$rows = $this->_db->select('SELECT * FROM ' . $this->_table . '_groups WHERE share_id = ?', array($share['share_id']));
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}

foreach ($rows as $row) {
Expand All @@ -239,7 +239,7 @@ protected function _getShare($name)
try {
$results = $this->_db->selectOne('SELECT * FROM ' . $this->_table . ' WHERE share_name = ?', array($name));
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}
if (!$results) {
throw new Horde_Exception_NotFound(sprintf('Share name %s not found', $name));
Expand Down Expand Up @@ -309,7 +309,7 @@ protected function _getShareById($id)
try {
$results = $this->_db->selectOne('SELECT * FROM ' . $this->_table . ' WHERE share_id = ?', array($id));
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}
if (!$results) {
throw new Horde_Exception_NotFound(sprintf('Share id %s not found', $id));
Expand All @@ -336,7 +336,7 @@ protected function _getShares(array $ids)
try {
$rows = $this->_db->select('SELECT * FROM ' . $this->_table . ' WHERE share_id IN (' . str_repeat('?, ', count($ids) - 1) . '?)', $ids);
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}

$sharelist = array();
Expand Down Expand Up @@ -376,7 +376,7 @@ protected function _listAllShares()
try {
$rows = $this->_db->select('SELECT * FROM ' . $this->_table . ' ORDER BY share_name ASC');
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}

foreach ($rows as $share) {
Expand All @@ -400,7 +400,7 @@ protected function _listAllShares()
try {
$rows = $this->_db->select('SELECT * FROM ' . $this->_table . '_groups');
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}
foreach ($rows as $row) {
if (isset($shares[$row['share_id']])) {
Expand Down Expand Up @@ -472,7 +472,7 @@ public function listShares($userid, array $params = array())
try {
$rows = $this->_db->select($query);
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}

$users = array();
Expand All @@ -496,7 +496,7 @@ public function listShares($userid, array $params = array())
try {
$rows = $this->_db->select($query, $users);
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}
foreach ($rows as $share) {
$shares[$share['share_id']]['perm']['users'][$share['user_uid']] = (int)$share['perm'];
Expand All @@ -510,7 +510,7 @@ public function listShares($userid, array $params = array())
try {
$rows = $this->_db->select($query, $groups);
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}
foreach ($rows as $share) {
$shares[$share['share_id']]['perm']['groups'][$share['group_uid']] = (int)$share['perm'];
Expand Down Expand Up @@ -556,7 +556,7 @@ protected function _fetchClobFields(&$shares)
}
}
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}
}
}
Expand Down Expand Up @@ -675,7 +675,7 @@ public function listSystemShares()
try {
$rows = $this->_db->select($query);
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}

$sharelist = array();
Expand Down Expand Up @@ -798,7 +798,7 @@ protected function _removeShare(Horde_Share_Object $share)
try {
$this->_db->delete('DELETE FROM ' . $table . ' WHERE share_id = ?', $params);
} catch (Horde_Db_Exception $e) {
throw new Horde_Share_Exception($e->getMessage());
throw new Horde_Share_Exception($e);
}
}
}
Expand Down

0 comments on commit 94c8aa6

Please sign in to comment.