From: Gunnar Wrobel
Date: Thu, 11 Feb 2010 10:07:15 +0000 (+0100)
Subject: Extract PEAR and exception handling into a separate class.
X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=db011a2a40263b0bddcc42b1071f52a1e1bd2a83;p=horde.git
Extract PEAR and exception handling into a separate class.
Again we always know when we throw a PEAR Error or an exception at
Horde_Exception. It is not necessary to have the class trying to
determine what the arguments might have been.
---
diff --git a/ansel/config/hooks.php.dist b/ansel/config/hooks.php.dist
index d1cda7b4f..b7f565879 100644
--- a/ansel/config/hooks.php.dist
+++ b/ansel/config/hooks.php.dist
@@ -19,7 +19,7 @@ class Ansel_Hooks
// $query = 'SELECT age FROM user WHERE user_uid = ' . $GLOBALS['ansel_db']->quote(Horde_Auth::getAuth());
// $result = $GLOBALS['ansel_db']->queryOne($query);
// if (is_a($result, 'PEAR_Error')) {
-// throw new Horde_Exception($result);
+// throw new Horde_Exception_Prior($result);
// }
//
// return (int)$result;
@@ -84,7 +84,7 @@ class Ansel_Hooks
// } catch (Horde_Service_Facebook_Exception $e) {
// // For now, just pass back as a pear error...needs to be cleaned up
// $GLOBALS['notification']->push('Horde_Service_Facebook: ' . $e->getMessage(), 'horde.err');
-// throw new Horde_Exception($e);
+// throw new Horde_Exception_Prior($e);
// }
// if (!empty($GLOBALS['notification'])) {
// $GLOBALS['notification']->push('Notification published to Facebook.', 'horde.success');
diff --git a/ansel/lib/Application.php b/ansel/lib/Application.php
index 064cf3348..cf27dbb6d 100644
--- a/ansel/lib/Application.php
+++ b/ansel/lib/Application.php
@@ -65,7 +65,7 @@ class Ansel_Application extends Horde_Registry_Application
// Create db, share, and vfs instances.
$GLOBALS['ansel_db'] = Ansel::getDb();
if (is_a($GLOBALS['ansel_db'], 'PEAR_Error')) {
- throw new Horde_Exception($GLOBALS['ansel_db']);
+ throw new Horde_Exception_Prior($GLOBALS['ansel_db']);
}
$GLOBALS['ansel_storage'] = new Ansel_Storage();
diff --git a/ansel/lib/Faces.php b/ansel/lib/Faces.php
index 06962f353..0ddec859d 100644
--- a/ansel/lib/Faces.php
+++ b/ansel/lib/Faces.php
@@ -50,7 +50,7 @@ class Ansel_Faces
$sql = 'SELECT face_id FROM ansel_faces WHERE image_id = ' . $image->id;
$face = $GLOBALS['ansel_db']->queryCol($sql);
if ($face instanceof PEAR_Error) {
- throw new Horde_Exception($face);
+ throw new Horde_Exception_Prior($face);
}
foreach ($face as $id) {
diff --git a/ansel/lib/Faces/Base.php b/ansel/lib/Faces/Base.php
index e00fb2918..c3c8097b1 100644
--- a/ansel/lib/Faces/Base.php
+++ b/ansel/lib/Faces/Base.php
@@ -93,7 +93,7 @@ class Ansel_Faces_Base
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
@@ -133,7 +133,7 @@ class Ansel_Faces_Base
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
@@ -177,7 +177,7 @@ class Ansel_Faces_Base
$GLOBALS['ansel_db']->setLimit($count, $from);
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
@@ -378,7 +378,7 @@ class Ansel_Faces_Base
$img = Ansel::getImageObject();
$data = $GLOBALS['ansel_vfs']->read($vfspath, $vfsname);
if ($data instanceof PEAR_Error) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
}
$img->loadString($face_id, $data);
@@ -444,7 +444,7 @@ class Ansel_Faces_Base
$new = true;
$face_id = $GLOBALS['ansel_db']->nextId('ansel_faces');
if ($face_id instanceof PEAR_Error) {
- throw new Horde_Exception($face_id);
+ throw new Horde_Exception_Prior($face_id);
}
}
@@ -490,12 +490,12 @@ class Ansel_Faces_Base
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute($params);
$q->free();
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
// Update gallery and image counts
@@ -544,7 +544,7 @@ class Ansel_Faces_Base
// Create Face id
$face_id = $GLOBALS['ansel_db']->nextId('ansel_faces');
if ($face_id instanceof PEAR_Error) {
- throw new Horde_Exception($face_id);
+ throw new Horde_Exception_Prior($face_id);
}
// Store face id db
@@ -556,12 +556,12 @@ class Ansel_Faces_Base
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute($params);
$q->free();
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($create) {
// Process image
@@ -615,7 +615,7 @@ class Ansel_Faces_Base
$result = $GLOBALS['ansel_vfs']->writeData($path . 'faces', $face_id . $ext,
$image->_image->raw(), true);
if (is_a($result, 'PEAR_Error')) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
return $face_id;
@@ -651,12 +651,12 @@ class Ansel_Faces_Base
$params = array(puzzle_compress_cvec($signature), $face_id);
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute($params);
$q->free();
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
// create index
@@ -673,7 +673,7 @@ class Ansel_Faces_Base
$GLOBALS['ansel_db']->exec('DELETE FROM ansel_faces_index WHERE face_id = ' . $face_id);
$q = &$GLOBALS['ansel_db']->prepare('INSERT INTO ansel_faces_index (face_id, index_position, index_part) VALUES (?, ?, ?)');
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$GLOBALS['ansel_db']->loadModule('Extended');
@@ -748,7 +748,7 @@ class Ansel_Faces_Base
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
return $q->execute($params);
@@ -769,19 +769,19 @@ class Ansel_Faces_Base
$sql .= ' FROM ansel_faces WHERE face_id = ?';
$q = $GLOBALS['ansel_db']->prepare($sql);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute((int)$face_id);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
throw new Horde_Exception('Face does not exist');
}
$face = $result->fetchRow(MDB2_FETCHMODE_ASSOC);
if (is_a($face, 'PEAR_Error')) {
- throw new Horde_Exception($face);
+ throw new Horde_Exception_Prior($face);
}
// Always return the face_id
@@ -800,7 +800,7 @@ class Ansel_Faces_Base
$sql = 'SELECT gallery_id, image_id FROM ansel_faces WHERE face_name = ' . $GLOBALS['ansel_db']->quote($face['face_name']);
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
throw new Horde_Exception('Face does not exist');
}
@@ -854,7 +854,7 @@ class Ansel_Faces_Base
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
diff --git a/ansel/lib/Image.php b/ansel/lib/Image.php
index 237478e8c..bc4441695 100644
--- a/ansel/lib/Image.php
+++ b/ansel/lib/Image.php
@@ -328,7 +328,7 @@ class Ansel_Image
try {
$this->_data[$view] = $this->_image->raw();
} catch (Horde_Image_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$this->_image->loadString($vfspath . '/' . $this->id,
$this->_data[$view]);
diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php
index 51d42a15d..3c1991509 100644
--- a/ansel/lib/Storage.php
+++ b/ansel/lib/Storage.php
@@ -171,7 +171,7 @@ class Ansel_Storage
$error = sprintf(_("The gallery \"%s\" could not be created: %s"),
$attributes['name'], $result->getMessage());
Horde::logMessage($error, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($error);
+ throw new Horde_Exception_Prior($error);
}
/* Convenience */
diff --git a/crumb/lib/Driver/sql.php b/crumb/lib/Driver/sql.php
index 9f01a8e1f..e802fdc36 100644
--- a/crumb/lib/Driver/sql.php
+++ b/crumb/lib/Driver/sql.php
@@ -120,7 +120,7 @@ class Crumb_Driver_sql extends Crumb_Driver {
$this->_write_db = &DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
@@ -138,7 +138,7 @@ class Crumb_Driver_sql extends Crumb_Driver {
$this->_db = &DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
diff --git a/folks/config/hooks.php.dist b/folks/config/hooks.php.dist
index a06565028..1e74e7db6 100644
--- a/folks/config/hooks.php.dist
+++ b/folks/config/hooks.php.dist
@@ -278,7 +278,7 @@ class Folks_Hooks
$result = $_db->getRow($query, array($username, $info['extra']['email']), DB_FETCHMODE_ASSOC);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif (empty($result)) {
return $info;
} elseif ($result['user_uid'] == $username) {
@@ -319,7 +319,7 @@ class Folks_Hooks
$result = $_db->query($query, $values);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/Folks.php';
diff --git a/folks/lib/Application.php b/folks/lib/Application.php
index b48940288..9a7f7ea22 100644
--- a/folks/lib/Application.php
+++ b/folks/lib/Application.php
@@ -111,7 +111,7 @@ class Folks_Application extends Horde_Registry_Application
$result = $GLOBALS['folks_driver']->addUser($userId, $credentials);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
}
diff --git a/folks/lib/Driver.php b/folks/lib/Driver.php
index de6d41c61..96337df07 100644
--- a/folks/lib/Driver.php
+++ b/folks/lib/Driver.php
@@ -101,7 +101,7 @@ class Folks_Driver {
try {
$result = $img->loadFile($file);
} catch (Horde_Image_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$dimensions = $img->getDimensions();
if ($dimensions instanceof PEAR_Error) {
diff --git a/folks/lib/Driver/sql.php b/folks/lib/Driver/sql.php
index b14bf3f0c..69a801e24 100644
--- a/folks/lib/Driver/sql.php
+++ b/folks/lib/Driver/sql.php
@@ -584,7 +584,7 @@ class Folks_Driver_sql extends Folks_Driver {
$this->_write_db = DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
@@ -602,7 +602,7 @@ class Folks_Driver_sql extends Folks_Driver {
$this->_db = DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
diff --git a/folks/lib/Friends/sql.php b/folks/lib/Friends/sql.php
index 9c10c724c..8bd989d9b 100644
--- a/folks/lib/Friends/sql.php
+++ b/folks/lib/Friends/sql.php
@@ -223,7 +223,7 @@ class Folks_Friends_sql extends Folks_Friends {
$this->_write_db = DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
@@ -241,7 +241,7 @@ class Folks_Friends_sql extends Folks_Friends {
$this->_db = DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
diff --git a/framework/Ajax/lib/Horde/Ajax/Imple/Geocoder/Geonames.php b/framework/Ajax/lib/Horde/Ajax/Imple/Geocoder/Geonames.php
index 562982810..b2193cf8f 100644
--- a/framework/Ajax/lib/Horde/Ajax/Imple/Geocoder/Geonames.php
+++ b/framework/Ajax/lib/Horde/Ajax/Imple/Geocoder/Geonames.php
@@ -61,7 +61,7 @@ class Horde_Ajax_Imple_Geocoder_Geonames extends Horde_Ajax_Imple_Base
try {
$response = $client->get($url);
} catch (Horde_Http_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
return array('status' => 200,
'results' => $response->getBody());
diff --git a/framework/Auth/lib/Horde/Auth/Exception.php b/framework/Auth/lib/Horde/Auth/Exception.php
index 102be34f6..2d9b7b43e 100644
--- a/framework/Auth/lib/Horde/Auth/Exception.php
+++ b/framework/Auth/lib/Horde/Auth/Exception.php
@@ -11,6 +11,6 @@
* @author Michael Slusarz
* @package Horde_Auth
*/
-class Horde_Auth_Exception extends Horde_Exception
+class Horde_Auth_Exception extends Horde_Exception_Prior
{
}
diff --git a/framework/Auth/lib/Horde/Auth/Signup/Sql.php b/framework/Auth/lib/Horde/Auth/Signup/Sql.php
index bd6e10560..0e5ac3b39 100644
--- a/framework/Auth/lib/Horde/Auth/Signup/Sql.php
+++ b/framework/Auth/lib/Horde/Auth/Signup/Sql.php
@@ -232,7 +232,7 @@ class Horde_Auth_Signup_Sql extends Horde_Auth_Signup
unset($params['charset']);
$this->_write_db = MDB2::factory($params);
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Set DB portability options. */
@@ -251,7 +251,7 @@ class Horde_Auth_Signup_Sql extends Horde_Auth_Signup
$params = array_merge($params, $this->_params['read']);
$this->_db = MDB2::factory($params);
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
/* Set DB portability options. */
diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php
index 9876e9419..bdc9052df 100644
--- a/framework/Core/lib/Horde/Registry.php
+++ b/framework/Core/lib/Horde/Registry.php
@@ -768,7 +768,7 @@ class Horde_Registry
try {
$result = call_user_func_array(array($api, $call), $args);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
} catch (Horde_Exception $e) {
$result = $e;
diff --git a/framework/Exception/lib/Horde/Exception.php b/framework/Exception/lib/Horde/Exception.php
index f849a7268..2c2553d33 100644
--- a/framework/Exception/lib/Horde/Exception.php
+++ b/framework/Exception/lib/Horde/Exception.php
@@ -12,25 +12,4 @@
*/
class Horde_Exception extends Exception
{
- /**
- * Exception constructor
- *
- * @param mixed $message The exception message, a PEAR_Error
- * object, or an Exception object.
- * @param int $code A numeric error code.
- */
- public function __construct($message = null, $code = null)
- {
- if (is_object($message) &&
- method_exists($message, 'getMessage')) {
- if (is_null($code) &&
- method_exists($message, 'getCode')) {
- $code = $message->getCode();
- }
- $message = $message->getMessage();
- }
-
- parent::__construct($message, $code);
- }
-
}
diff --git a/framework/Exception/lib/Horde/Exception/Prior.php b/framework/Exception/lib/Horde/Exception/Prior.php
new file mode 100644
index 000000000..f3c1356ea
--- /dev/null
+++ b/framework/Exception/lib/Horde/Exception/Prior.php
@@ -0,0 +1,37 @@
+getCode();
+ }
+ $message = $message->getMessage();
+ }
+
+ parent::__construct($message, $code);
+ }
+
+}
diff --git a/framework/Exception/package.xml b/framework/Exception/package.xml
index 7123f9145..7a44d2547 100644
--- a/framework/Exception/package.xml
+++ b/framework/Exception/package.xml
@@ -46,6 +46,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
+
@@ -67,7 +68,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
+
+/>
diff --git a/framework/Exception/test/Horde/Exception/ExceptionTest.php b/framework/Exception/test/Horde/Exception/ExceptionTest.php
index 6667fab28..0e4c84cec 100644
--- a/framework/Exception/test/Horde/Exception/ExceptionTest.php
+++ b/framework/Exception/test/Horde/Exception/ExceptionTest.php
@@ -15,6 +15,7 @@
* Require the tested classes.
*/
require_once 'Horde/Exception.php';
+require_once 'Horde/Exception/Prior.php';
require_once 'Horde/Exception/LastError.php';
/**
@@ -36,13 +37,13 @@ class Horde_Exception_ExceptionTest extends PHPUnit_Framework_TestCase
public function testEmptyConstructionYieldsEmptyMessage()
{
- $e = new Horde_Exception();
+ $e = new Horde_Exception_Prior();
$this->assertSame('', $e->getMessage());
}
public function testEmptyConstructionYieldsCodeZero()
{
- $e = new Horde_Exception();
+ $e = new Horde_Exception_Prior();
$this->assertSame(0, $e->getCode());
}
@@ -50,7 +51,7 @@ class Horde_Exception_ExceptionTest extends PHPUnit_Framework_TestCase
{
require_once dirname(__FILE__) . '/Stub/PearError.php';
$p = new Horde_Exception_Stub_PearError('pear');
- $e = new Horde_Exception($p);
+ $e = new Horde_Exception_Prior($p);
$this->assertSame('pear', $e->getMessage());
}
@@ -58,7 +59,7 @@ class Horde_Exception_ExceptionTest extends PHPUnit_Framework_TestCase
{
require_once dirname(__FILE__) . '/Stub/PearError.php';
$p = new Horde_Exception_Stub_PearError('pear', 666);
- $e = new Horde_Exception($p);
+ $e = new Horde_Exception_Prior($p);
$this->assertSame(666, $e->getCode());
}
@@ -92,12 +93,6 @@ class Horde_Exception_ExceptionTest extends PHPUnit_Framework_TestCase
$this->assertSame('An error occurred: get_last_error', $e->getMessage());
}
- public function testStringCodesAreSetToNull()
- {
- $e = new Horde_Exception('test', 'some code');
- $this->assertSame(0, $e->getCode());
- }
-
private function _getLastError()
{
return array(
diff --git a/framework/Group/Group/contactlists.php b/framework/Group/Group/contactlists.php
index 6a33dfd84..e6be7732b 100644
--- a/framework/Group/Group/contactlists.php
+++ b/framework/Group/Group/contactlists.php
@@ -595,7 +595,7 @@ class Group_contactlists extends Group {
$this->_db[$source] = &DB::connect($this->_sources[$source]['params'],
array('persistent' => !empty($this->_sources[$source]['params']['persistent'])));
if (is_a($this->_db[$source], 'PEAR_Error')) {
- throw new Horde_Exception($this->_db[$source]);
+ throw new Horde_Exception_Prior($this->_db[$source]);
}
/* Set DB portability options. */
diff --git a/framework/Group/Group/sql.php b/framework/Group/Group/sql.php
index 3f361a3f0..899e77ce8 100644
--- a/framework/Group/Group/sql.php
+++ b/framework/Group/Group/sql.php
@@ -719,7 +719,7 @@ class Group_sql extends Group {
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Set DB portability options. */
@@ -738,7 +738,7 @@ class Group_sql extends Group {
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
/* Set DB portability options. */
diff --git a/framework/Image/lib/Horde/Image/Exception.php b/framework/Image/lib/Horde/Image/Exception.php
index c08aa11d1..8e62fce77 100644
--- a/framework/Image/lib/Horde/Image/Exception.php
+++ b/framework/Image/lib/Horde/Image/Exception.php
@@ -6,6 +6,6 @@
* @category Horde
* @package Horde_Image
*/
-class Horde_Image_Exception extends Exception {
+class Horde_Image_Exception extends Horde_Exception_Prior {
}
?>
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Exception.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Exception.php
index 79a7c88f6..a62402ae0 100644
--- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Exception.php
+++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Exception.php
@@ -25,7 +25,7 @@
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server_Exception extends Horde_Exception
+class Horde_Kolab_Server_Exception extends Horde_Exception_Prior
{
/**
* Constants to define the error type.
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Exception.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Exception.php
index 90ea79477..20a579371 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Exception.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Exception.php
@@ -25,6 +25,6 @@
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Session
*/
-class Horde_Kolab_Session_Exception extends Horde_Exception
+class Horde_Kolab_Session_Exception extends Horde_Exception_Prior
{
}
\ No newline at end of file
diff --git a/framework/Mime/lib/Horde/Mime/Exception.php b/framework/Mime/lib/Horde/Mime/Exception.php
index a4a8cb844..c1a8e4b0f 100644
--- a/framework/Mime/lib/Horde/Mime/Exception.php
+++ b/framework/Mime/lib/Horde/Mime/Exception.php
@@ -11,6 +11,6 @@
* @category Horde
* @package Horde_Mime
*/
-class Horde_Mime_Exception extends Horde_Exception
+class Horde_Mime_Exception extends Horde_Exception_Prior
{
}
diff --git a/framework/Perms/lib/Horde/Perms/Exception.php b/framework/Perms/lib/Horde/Perms/Exception.php
index 55dd6f0d8..792f6dd25 100644
--- a/framework/Perms/lib/Horde/Perms/Exception.php
+++ b/framework/Perms/lib/Horde/Perms/Exception.php
@@ -11,6 +11,6 @@
* @category Horde
* @package Horde_Perms
*/
-class Horde_Perms_Exception extends Horde_Exception
+class Horde_Perms_Exception extends Horde_Exception_Prior
{
}
diff --git a/framework/Prefs/lib/Horde/Prefs/Imsp.php b/framework/Prefs/lib/Horde/Prefs/Imsp.php
index 92cf062a5..84b04a565 100644
--- a/framework/Prefs/lib/Horde/Prefs/Imsp.php
+++ b/framework/Prefs/lib/Horde/Prefs/Imsp.php
@@ -147,7 +147,7 @@ class Horde_Prefs_Imsp extends Horde_Prefs
$result = $this->_imsp->init();
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$this->_imsp->setLogger($GLOBALS['conf']['log']);
diff --git a/framework/Prefs/lib/Horde/Prefs/KolabImap.php b/framework/Prefs/lib/Horde/Prefs/KolabImap.php
index db9071b45..ad8d2a00c 100644
--- a/framework/Prefs/lib/Horde/Prefs/KolabImap.php
+++ b/framework/Prefs/lib/Horde/Prefs/KolabImap.php
@@ -41,7 +41,7 @@ class Horde_Prefs_KolabImap extends Horde_Prefs
$default = $shares->getDefaultShare();
if ($default instanceof PEAR_Error) {
Horde::logMessage($default, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($default);
+ throw new Horde_Exception_Prior($default);
}
$this->_share = $default->getName();
@@ -49,13 +49,13 @@ class Horde_Prefs_KolabImap extends Horde_Prefs
$connection = new Kolab('h-prefs');
if ($connection instanceof PEAR_Error) {
Horde::logMessage($connection, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($connection);
+ throw new Horde_Exception_Prior($connection);
}
$result = $this->_connection->open($this->_share, 1);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$this->_connection = $connection;
@@ -128,7 +128,7 @@ class Horde_Prefs_KolabImap extends Horde_Prefs
$prefs = $this->_connection->getObjects();
if ($prefs instanceof PEAR_Error) {
Horde::logMessage($prefs, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($prefs);
+ throw new Horde_Exception_Prior($prefs);
}
foreach ($prefs as $pref) {
diff --git a/framework/Prefs/lib/Horde/Prefs/Sql.php b/framework/Prefs/lib/Horde/Prefs/Sql.php
index 33a1bac57..e64bf0e17 100644
--- a/framework/Prefs/lib/Horde/Prefs/Sql.php
+++ b/framework/Prefs/lib/Horde/Prefs/Sql.php
@@ -342,7 +342,7 @@ class Horde_Prefs_Sql extends Horde_Prefs
'ssl' => !empty($this->_params['ssl'])));
if ($this->_write_db instanceof PEAR_Error) {
Horde::logMessage($this->_write_db, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
@@ -365,7 +365,7 @@ class Horde_Prefs_Sql extends Horde_Prefs
'ssl' => !empty($params['ssl'])));
if ($this->_db instanceof PEAR_Error) {
Horde::logMessage($this->_db, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
diff --git a/framework/Release/lib/Horde/Release.php b/framework/Release/lib/Horde/Release.php
index 2b88b02fd..a52cb8e83 100644
--- a/framework/Release/lib/Horde/Release.php
+++ b/framework/Release/lib/Horde/Release.php
@@ -674,7 +674,7 @@ class Horde_Release
array('Content-Type' => 'application/json'));
} catch (Horde_Http_Exception $e) {
if (strpos($e->getMessage(), '201 Created') === false) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} else {
return '';
}
@@ -695,7 +695,7 @@ class Horde_Release
try {
$response = $http->get('http://freshmeat.net/projects/' . $this->notes['fm']['project'] . '/urls.json?auth_code=' . $this->_options['fm']['user_token']);
} catch (Horde_Http_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$url_response = Horde_Serialize::unserialize($response->getBody(), Horde_Serialize::JSON);
@@ -728,7 +728,7 @@ class Horde_Release
$response = $response->getBody();
} catch (Horde_Http_Exception $e) {
if (strpos($e->getMessage(), '201 Created') === false) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} else {
$response = '';
}
@@ -742,7 +742,7 @@ class Horde_Release
$response = $response->getBody();
// Status: 200???
} catch (Horde_Http_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
}
}
diff --git a/framework/Release/lib/Horde/Release/Whups.php b/framework/Release/lib/Horde/Release/Whups.php
index 8c8aaef7b..615cd9168 100644
--- a/framework/Release/lib/Horde/Release/Whups.php
+++ b/framework/Release/lib/Horde/Release/Whups.php
@@ -59,7 +59,7 @@ class Horde_Release_Whups
$res = Horde_Rpc::request('jsonrpc', $this->_params['url'], $method, $params, $options);
if ($res instanceof PEAR_Error) {
- throw new Horde_Exception($res);
+ throw new Horde_Exception_Prior($res);
}
}
@@ -100,7 +100,7 @@ class Horde_Release_Whups
null, array('user' => $this->_params['user'],
'pass' => $this->_params['pass']));
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
return $result->result;
diff --git a/framework/Service_Twitter/lib/Horde/Service/Twitter/Exception.php b/framework/Service_Twitter/lib/Horde/Service/Twitter/Exception.php
index 33470a714..17390dfa6 100644
--- a/framework/Service_Twitter/lib/Horde/Service/Twitter/Exception.php
+++ b/framework/Service_Twitter/lib/Horde/Service/Twitter/Exception.php
@@ -8,5 +8,5 @@
* @category Horde
* @package Horde_Service_Twitter
*/
-class Horde_Service_Twitter_Exception extends Exception {
+class Horde_Service_Twitter_Exception extends Horde_Exception_Prior {
}
diff --git a/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php b/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php
index 4c5ad6f75..e9f74b663 100644
--- a/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php
+++ b/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php
@@ -88,7 +88,7 @@ class Horde_SessionHandler_Sql extends Horde_SessionHandler
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
$this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
@@ -101,7 +101,7 @@ class Horde_SessionHandler_Sql extends Horde_SessionHandler
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
$this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
} else {
diff --git a/framework/Share/Share/sql.php b/framework/Share/Share/sql.php
index f2d5f7d86..b146e3eaa 100644
--- a/framework/Share/Share/sql.php
+++ b/framework/Share/Share/sql.php
@@ -783,7 +783,7 @@ class Horde_Share_sql extends Horde_Share {
unset($params['charset']);
$this->_write_db = MDB2::factory($params);
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Attach debug handler. */
@@ -817,7 +817,7 @@ class Horde_Share_sql extends Horde_Share {
unset($params['charset']);
$this->_db = MDB2::singleton($params);
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
$this->_db->setOption('seqcol_name', 'id');
diff --git a/framework/SyncML/tests/testsync.php b/framework/SyncML/tests/testsync.php
index 21ec63fa1..dadcc7405 100755
--- a/framework/SyncML/tests/testsync.php
+++ b/framework/SyncML/tests/testsync.php
@@ -450,7 +450,7 @@ function testPre($name, $number)
$result = $GLOBALS['testbackend']->addEntry($service, $data, $contentType);
if (is_a($result, 'PEAR_Error')) {
echo "error importing data into $service:\n$data\n";
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($debuglevel >= 2) {
@@ -522,7 +522,7 @@ function testPre($name, $number)
$result = $GLOBALS['testbackend']->replaceEntry($service, $data, $contentType, $suid);
if (is_a($result, 'PEAR_Error')) {
echo "Error replacing data $locuri suid=$suid!\n";
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($debuglevel >= 2) {
@@ -561,7 +561,7 @@ function testPre($name, $number)
// @TODO: simulate a delete by just faking some history data.
if (is_a($result, 'PEAR_Error')) {
echo "Error deleting data $locuri!";
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($debuglevel >= 2) {
echo "simulated $service delete of $suid!\n";
diff --git a/framework/Token/lib/Horde/Token/Sql.php b/framework/Token/lib/Horde/Token/Sql.php
index 2a7931207..cb30b3810 100644
--- a/framework/Token/lib/Horde/Token/Sql.php
+++ b/framework/Token/lib/Horde/Token/Sql.php
@@ -106,7 +106,7 @@ class Horde_Token_Sql extends Horde_Token
$result = $this->_write_db->query($query, $values);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
}
@@ -157,7 +157,7 @@ class Horde_Token_Sql extends Horde_Token
$result = $this->_write_db->query($query, $values);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
}
@@ -195,7 +195,7 @@ class Horde_Token_Sql extends Horde_Token
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
@@ -217,7 +217,7 @@ class Horde_Token_Sql extends Horde_Token
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
diff --git a/framework/admintools/horde-create-sequence.php b/framework/admintools/horde-create-sequence.php
index 4941c42a5..4d2cb58bc 100755
--- a/framework/admintools/horde-create-sequence.php
+++ b/framework/admintools/horde-create-sequence.php
@@ -48,7 +48,7 @@ default:
throw new Horde_Exception('Unknown database abstraction library');
}
if (is_a($dbh, 'PEAR_Error')) {
- throw new Horde_Exception($dbh);
+ throw new Horde_Exception_Prior($dbh);
}
if (!preg_match('/^\w+$/', $sequence)) {
diff --git a/framework/admintools/horde-sql-shell.php b/framework/admintools/horde-sql-shell.php
index 8027e5766..57d1a6f6c 100755
--- a/framework/admintools/horde-sql-shell.php
+++ b/framework/admintools/horde-sql-shell.php
@@ -15,7 +15,7 @@ Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true
$dbh = DB::connect($conf['sql']);
if (is_a($dbh, 'PEAR_Error')) {
- throw new Horde_Exception($dbh);
+ throw new Horde_Exception_Prior($dbh);
}
$dbh->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
diff --git a/horde/admin/groups.php b/horde/admin/groups.php
index 4d5a70f7d..76d0a2997 100644
--- a/horde/admin/groups.php
+++ b/horde/admin/groups.php
@@ -191,7 +191,7 @@ if (!empty($form)) {
/* Get the perms tree. */
$nodes = $groups->listGroups(true);
if (is_a($nodes, 'PEAR_Error')) {
- throw new Horde_Exception($nodes);
+ throw new Horde_Exception_Prior($nodes);
}
$nodes[GROUP_ROOT] = GROUP_ROOT;
@@ -216,7 +216,7 @@ $tree->setHeader(array(array('width' => '50%')));
if ($cid > 0) {
$cid_parents = $groups->getGroupParentList($cid);
if (is_a($cid_parents, 'PEAR_Error')) {
- throw new Horde_Exception($cid_parents);
+ throw new Horde_Exception_Prior($cid_parents);
}
}
diff --git a/horde/admin/signup_confirm.php b/horde/admin/signup_confirm.php
index 83a0eba4b..a28f3a77d 100644
--- a/horde/admin/signup_confirm.php
+++ b/horde/admin/signup_confirm.php
@@ -35,7 +35,7 @@ if (hash_hmac('sha1', $user, $conf['secret_key']) != $hash) {
if ($action == 'deny') {
$result = $signup->removeQueuedSignup($user);
if (is_a($result, 'PEAR_Error')) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
printf(_("The signup request for user \"%s\" has been removed."), $user);
exit;
diff --git a/horde/admin/sqlshell.php b/horde/admin/sqlshell.php
index 47c97d6e3..f4160023e 100644
--- a/horde/admin/sqlshell.php
+++ b/horde/admin/sqlshell.php
@@ -26,7 +26,7 @@ require HORDE_TEMPLATES . '/admin/menu.inc';
$dbh = DB::connect($conf['sql']);
if (is_a($dbh, 'PEAR_Error')) {
- throw new Horde_Exception($dbh);
+ throw new Horde_Exception_Prior($dbh);
}
$dbh->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
diff --git a/horde/admin/user.php b/horde/admin/user.php
index 1dcaf0d80..b3ec67ae4 100644
--- a/horde/admin/user.php
+++ b/horde/admin/user.php
@@ -242,7 +242,7 @@ if ($auth->hasCapability('list')) {
$users = $auth->listUsers();
if (is_a($users, 'PEAR_Error')) {
- throw new Horde_Exception($users);
+ throw new Horde_Exception_Prior($users);
}
/* Returns only users that match the specified pattern. */
diff --git a/horde/config/hooks.php.dist b/horde/config/hooks.php.dist
index 165040b8a..27311f94b 100644
--- a/horde/config/hooks.php.dist
+++ b/horde/config/hooks.php.dist
@@ -566,7 +566,7 @@ class Horde_Hooks
// $result = $db->query($query);
//
// if ($result instanceof PEAR_Error) {
-// throw new Horde_Exception($result);
+// throw new Horde_Exception_Prior($result);
// }
// }
diff --git a/imp/lib/Compose/Exception.php b/imp/lib/Compose/Exception.php
index 2cab0e60c..1a7ca2e08 100644
--- a/imp/lib/Compose/Exception.php
+++ b/imp/lib/Compose/Exception.php
@@ -11,7 +11,7 @@
* @author Michael Slusarz
* @package IMP
*/
-class IMP_Compose_Exception extends Horde_Exception
+class IMP_Compose_Exception extends Horde_Exception_Prior
{
/**
* Stores information on whether an encryption dialog window needs
diff --git a/imp/lib/Exception.php b/imp/lib/Exception.php
index 5a0469674..e29dfcbf9 100644
--- a/imp/lib/Exception.php
+++ b/imp/lib/Exception.php
@@ -10,6 +10,6 @@
* @author Michael Slusarz
* @package IMP
*/
-class IMP_Exception extends Horde_Exception
+class IMP_Exception extends Horde_Exception_Prior
{
}
diff --git a/imp/lib/Quota/Sql.php b/imp/lib/Quota/Sql.php
index 95a326eac..c7ed327c0 100644
--- a/imp/lib/Quota/Sql.php
+++ b/imp/lib/Quota/Sql.php
@@ -82,7 +82,7 @@ class IMP_Quota_Sql extends IMP_Quota
$this->_params['query_quota']);
$result = $this->_db->query($query);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
@@ -103,7 +103,7 @@ class IMP_Quota_Sql extends IMP_Quota
$this->_params['query_used']);
$result = $this->_db->query($query);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
diff --git a/imp/lib/Sentmail/Sql.php b/imp/lib/Sentmail/Sql.php
index b09553af9..b4c5bf4c3 100644
--- a/imp/lib/Sentmail/Sql.php
+++ b/imp/lib/Sentmail/Sql.php
@@ -63,7 +63,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
/* Set DB portability options. */
@@ -146,7 +146,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail
$recipients = $this->_db->getAll($query);
if ($recipients instanceof PEAR_Error) {
Horde::logMessage($recipients, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($recipients);
+ throw new Horde_Exception_Prior($recipients);
}
/* Extract email addresses. */
@@ -185,7 +185,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail
$recipients = $this->_db->getOne($query, array(time() - $hours * 3600));
if ($recipients instanceof PEAR_Error) {
Horde::logMessage($recipients, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($recipients);
+ throw new Horde_Exception_Prior($recipients);
}
return $recipients;
diff --git a/imp/lib/Ui/Compose.php b/imp/lib/Ui/Compose.php
index 62b9bb6ad..df12f4b11 100644
--- a/imp/lib/Ui/Compose.php
+++ b/imp/lib/Ui/Compose.php
@@ -70,7 +70,7 @@ class IMP_Ui_Compose
try {
$recip = $imp_compose->recipientList(array('to' => $to));
} catch (IMP_Compose_Exception $e) {
- throw new Horde_Exception($recip);
+ throw new Horde_Exception_Prior($recip);
}
$recipients = implode(', ', $recip['list']);
@@ -95,7 +95,7 @@ class IMP_Ui_Compose
try {
$imp_compose->sendMessage($recipients, $headers, $mime_message);
} catch (IMP_Compose_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$entry = sprintf("%s Redirected message sent to %s from %s",
diff --git a/imp/pgp.php b/imp/pgp.php
index fb43cfb27..336bced34 100644
--- a/imp/pgp.php
+++ b/imp/pgp.php
@@ -66,7 +66,7 @@ case 'process_import_public_key':
$imp_pgp->reloadWindow(Horde_Util::getFormData('reload'));
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No PGP public key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e, 'horde.error');
$actionID = 'import_public_key';
@@ -106,7 +106,7 @@ case 'process_import_personal_public_key':
}
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No personal PGP public key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e->getMessage(), 'horde.error');
$imp_pgp->importKeyDialog('process_import_personal_public_key', Horde_Util::getFormData('reload'));
@@ -133,7 +133,7 @@ case 'process_import_personal_private_key':
}
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No personal PGP private key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e->getMessage(), 'horde.error');
$imp_pgp->importKeyDialog('process_import_personal_private_key', Horde_Util::getFormData('reload'));
diff --git a/imp/smime.php b/imp/smime.php
index 924bb7137..eca74176c 100644
--- a/imp/smime.php
+++ b/imp/smime.php
@@ -48,7 +48,7 @@ case 'process_import_public_key':
$imp_smime->reloadWindow(Horde_Util::getFormData('reload'));
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No S/MIME public key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e, 'horde.error');
$actionID = 'import_public_key';
@@ -93,7 +93,7 @@ case 'process_import_personal_certs':
$notification->push(_("S/MIME Public/Private Keypair successfully added."), 'horde.success');
$imp_smime->reloadWindow(Horde_Util::getFormData('reload'));
} catch (Horde_Browser_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push(_("Personal S/MIME certificates NOT imported: ") . $e->getMessage(), 'horde.error');
$actionID = 'import_personal_certs';
diff --git a/ingo/lib/Exception.php b/ingo/lib/Exception.php
index a8df59f6c..e5d275d98 100644
--- a/ingo/lib/Exception.php
+++ b/ingo/lib/Exception.php
@@ -10,6 +10,6 @@
* @author Michael Slusarz
* @package Ingo
*/
-class Ingo_Exception extends Horde_Exception
+class Ingo_Exception extends Horde_Exception_Prior
{
}
diff --git a/ingo/lib/Storage/Sql.php b/ingo/lib/Storage/Sql.php
index 584b7c9f6..2daba7181 100644
--- a/ingo/lib/Storage/Sql.php
+++ b/ingo/lib/Storage/Sql.php
@@ -86,7 +86,7 @@ class Ingo_Storage_Sql extends Ingo_Storage
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Set DB portability options. */
switch ($this->_write_db->phptype) {
@@ -105,7 +105,7 @@ class Ingo_Storage_Sql extends Ingo_Storage
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
switch ($this->_db->phptype) {
diff --git a/kronolith/lib/Exception.php b/kronolith/lib/Exception.php
index d47346c4b..9ff3fdb9d 100644
--- a/kronolith/lib/Exception.php
+++ b/kronolith/lib/Exception.php
@@ -10,6 +10,6 @@
* @author Jan Schneider
* @package Kronolith
*/
-class Kronolith_Exception extends Horde_Exception
+class Kronolith_Exception extends Horde_Exception_Prior
{
}
diff --git a/news/files.php b/news/files.php
index 7ec48f392..a169d9a78 100644
--- a/news/files.php
+++ b/news/files.php
@@ -31,7 +31,7 @@ case 'download_file':
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
if (Horde_Auth::isAdmin('news:admin')) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
} else {
header('HTTP/1.0 404 Not Found');
echo 'HTTP/1.0 404 Not Found
';
@@ -48,7 +48,7 @@ case 'view_file':
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
if (Horde_Auth::isAdmin('news:admin')) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
} else {
header('HTTP/1.0 404 Not Found');
echo 'HTTP/1.0 404 Not Found
';
@@ -106,7 +106,7 @@ case 'download_zip':
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
if (Horde_Auth::isAdmin('news:admin')) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
} else {
header('HTTP/1.0 404 Not Found');
echo 'HTTP/1.0 404 Not Found
';
diff --git a/news/lib/Driver/sql.php b/news/lib/Driver/sql.php
index 1dd5756c7..935d6e440 100644
--- a/news/lib/Driver/sql.php
+++ b/news/lib/Driver/sql.php
@@ -397,7 +397,7 @@ class News_Driver_sql extends News_Driver {
$this->write_db = &DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->write_db);
+ throw new Horde_Exception_Prior($this->write_db);
}
// Set DB portability options.
@@ -415,7 +415,7 @@ class News_Driver_sql extends News_Driver {
$this->db = &DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->db instanceof PEAR_Error) {
- throw new Horde_Exception($this->db);
+ throw new Horde_Exception_Prior($this->db);
}
// Set DB portability options.
diff --git a/shout/lib/Exception.php b/shout/lib/Exception.php
index 97803302d..ca623f254 100644
--- a/shout/lib/Exception.php
+++ b/shout/lib/Exception.php
@@ -1,2 +1,2 @@
_db->query($query, $values);
if (is_a($result instanceof PEAR_Error)) {
- throw Horde_Exception($result);
+ throw Horde_Exception_Prior($result);
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
if ($row instanceof PEAR_Error) {
- throw Horde_Exception($row);
+ throw Horde_Exception_Prior($row);
}
/* Store the retrieved values in the foo variable. */
@@ -141,7 +141,7 @@ class Skeleton_Driver_Sql extends Skeleton_Driver
$this->_write_db = DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw Horde_Exception($this->_write_db);
+ throw Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
@@ -160,7 +160,7 @@ class Skeleton_Driver_Sql extends Skeleton_Driver
$this->_db = DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->_db instanceof PEAR_Error) {
- throw Horde_Exception($this->_db);
+ throw Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
diff --git a/turba/lib/Exception.php b/turba/lib/Exception.php
index e6fa54be6..752f5503a 100644
--- a/turba/lib/Exception.php
+++ b/turba/lib/Exception.php
@@ -10,6 +10,6 @@
* @author Jan Schneider
* @package Turba
*/
-class Turba_Exception extends Horde_Exception
+class Turba_Exception extends Horde_Exception_Prior
{
}