Extract PEAR and exception handling into a separate class.
authorGunnar Wrobel <p@rdus.de>
Thu, 11 Feb 2010 10:07:15 +0000 (11:07 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Thu, 11 Feb 2010 10:07:58 +0000 (11:07 +0100)
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.

59 files changed:
ansel/config/hooks.php.dist
ansel/lib/Application.php
ansel/lib/Faces.php
ansel/lib/Faces/Base.php
ansel/lib/Image.php
ansel/lib/Storage.php
crumb/lib/Driver/sql.php
folks/config/hooks.php.dist
folks/lib/Application.php
folks/lib/Driver.php
folks/lib/Driver/sql.php
folks/lib/Friends/sql.php
framework/Ajax/lib/Horde/Ajax/Imple/Geocoder/Geonames.php
framework/Auth/lib/Horde/Auth/Exception.php
framework/Auth/lib/Horde/Auth/Signup/Sql.php
framework/Core/lib/Horde/Registry.php
framework/Exception/lib/Horde/Exception.php
framework/Exception/lib/Horde/Exception/Prior.php [new file with mode: 0644]
framework/Exception/package.xml
framework/Exception/test/Horde/Exception/ExceptionTest.php
framework/Group/Group/contactlists.php
framework/Group/Group/sql.php
framework/Image/lib/Horde/Image/Exception.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Exception.php
framework/Kolab_Session/lib/Horde/Kolab/Session/Exception.php
framework/Mime/lib/Horde/Mime/Exception.php
framework/Perms/lib/Horde/Perms/Exception.php
framework/Prefs/lib/Horde/Prefs/Imsp.php
framework/Prefs/lib/Horde/Prefs/KolabImap.php
framework/Prefs/lib/Horde/Prefs/Sql.php
framework/Release/lib/Horde/Release.php
framework/Release/lib/Horde/Release/Whups.php
framework/Service_Twitter/lib/Horde/Service/Twitter/Exception.php
framework/SessionHandler/lib/Horde/SessionHandler/Sql.php
framework/Share/Share/sql.php
framework/SyncML/tests/testsync.php
framework/Token/lib/Horde/Token/Sql.php
framework/admintools/horde-create-sequence.php
framework/admintools/horde-sql-shell.php
horde/admin/groups.php
horde/admin/signup_confirm.php
horde/admin/sqlshell.php
horde/admin/user.php
horde/config/hooks.php.dist
imp/lib/Compose/Exception.php
imp/lib/Exception.php
imp/lib/Quota/Sql.php
imp/lib/Sentmail/Sql.php
imp/lib/Ui/Compose.php
imp/pgp.php
imp/smime.php
ingo/lib/Exception.php
ingo/lib/Storage/Sql.php
kronolith/lib/Exception.php
news/files.php
news/lib/Driver/sql.php
shout/lib/Exception.php
skeleton/lib/Driver/Sql.php
turba/lib/Exception.php

index d1cda7b..b7f5658 100644 (file)
@@ -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');
index 064cf33..cf27dbb 100644 (file)
@@ -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();
index 06962f3..0ddec85 100644 (file)
@@ -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) {
index e00fb29..c3c8097 100644 (file)
@@ -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();
         }
index 237478e..bc44416 100644 (file)
@@ -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]);
index 51d42a1..3c19915 100644 (file)
@@ -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 */
index 9f01a8e..e802fdc 100644 (file)
@@ -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.
index a065650..1e74e7d 100644 (file)
@@ -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';
index b489402..9a7f7ea 100644 (file)
@@ -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);
         }
     }
 
index de6d41c..96337df 100644 (file)
@@ -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) {
index b14bf3f..69a801e 100644 (file)
@@ -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.
index 9c10c72..8bd989d 100644 (file)
@@ -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.
index 5629828..b2193cf 100644 (file)
@@ -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());
index 102be34..2d9b7b4 100644 (file)
@@ -11,6 +11,6 @@
  * @author  Michael Slusarz <slusarz@curecanti.org>
  * @package Horde_Auth
  */
-class Horde_Auth_Exception extends Horde_Exception
+class Horde_Auth_Exception extends Horde_Exception_Prior
 {
 }
index bd6e105..0e5ac3b 100644 (file)
@@ -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. */
index 9876e94..bdc9052 100644 (file)
@@ -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;
index f849a72..2c2553d 100644 (file)
  */
 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 (file)
index 0000000..f3c1356
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Horde exception class that also accepts PEAR errors and exceptions as message
+ * input.
+ *
+ * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Horde_Exception
+ */
+class Horde_Exception_Prior extends Horde_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);
+    }
+
+}
index 7123f91..7a44d25 100644 (file)
@@ -46,6 +46,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
       <file name="LastError.php" role="php" />
       <file name="NotFound.php" role="php" />
       <file name="PermissionDenied.php" role="php" />
+      <file name="Prior.php" role="php" />
      </dir> <!-- /lib/Exception -->
      <file name="Exception.php" role="php" />
     </dir> <!-- /lib/Horde -->
@@ -67,7 +68,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <install name="lib/Horde/Exception.php" as="Horde/Exception.php" />
    <install name="lib/Horde/Exception/LastError.php" as="Horde/Exception/LastError.php" />
    <install name="lib/Horde/Exception/NotFound.php" as="Horde/Exception/NotFound.php" />
-   <install name="lib/Horde/Exception/PermissionDenied.php" as="Horde/Exception/PermissionDenied.php" />
+   <install name="lib/Horde/Exception/PermissionDenied.php" as="Horde/Exception/PermissionDenied.php"    <install name="lib/Horde/Exception/Prior.php" as="Horde/Exception/Prior.php" />
+/>
   </filelist>
  </phprelease>
  <changelog/>
index 6667fab..0e4c84c 100644 (file)
@@ -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(
index 6a33dfd..e6be773 100644 (file)
@@ -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. */
index 3f361a3..899e77c 100644 (file)
@@ -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. */
index c08aa11..8e62fce 100644 (file)
@@ -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
index 79a7c88..a62402a 100644 (file)
@@ -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.
index 90ea794..20a5793 100644 (file)
@@ -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
index a4a8cb8..c1a8e4b 100644 (file)
@@ -11,6 +11,6 @@
  * @category Horde
  * @package  Horde_Mime
  */
-class Horde_Mime_Exception extends Horde_Exception
+class Horde_Mime_Exception extends Horde_Exception_Prior
 {
 }
index 55dd6f0..792f6dd 100644 (file)
@@ -11,6 +11,6 @@
  * @category Horde
  * @package  Horde_Perms
  */
-class Horde_Perms_Exception extends Horde_Exception
+class Horde_Perms_Exception extends Horde_Exception_Prior
 {
 }
index 92cf062..84b04a5 100644 (file)
@@ -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']);
index db9071b..ad8d2a0 100644 (file)
@@ -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) {
index 33a1bac..e64bf0e 100644 (file)
@@ -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.
index 2b88b02..a52cb8e 100644 (file)
@@ -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);
                 }
             }
         }
index 8c8aaef..615cd91 100644 (file)
@@ -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;
index 33470a7..17390df 100644 (file)
@@ -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 {
 }
index 4c5ad6f..e9f74b6 100644 (file)
@@ -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 {
index f2d5f7d..b146e3e 100644 (file)
@@ -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');
index 21ec63f..dadcc74 100755 (executable)
@@ -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";
index 2a79312..cb30b38 100644 (file)
@@ -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.
index 4941c42..4d2cb58 100755 (executable)
@@ -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)) {
index 8027e57..57d1a6f 100755 (executable)
@@ -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);
 
index 4d5a70f..76d0a29 100644 (file)
@@ -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);
     }
 }
 
index 83a0eba..a28f3a7 100644 (file)
@@ -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;
index 47c97d6..f416002 100644 (file)
@@ -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);
 
index 1dcaf0d..b3ec67a 100644 (file)
@@ -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. */
index 165040b..27311f9 100644 (file)
@@ -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);
 //        }
 //    }
 
index 2cab0e6..1a7ca2e 100644 (file)
@@ -11,7 +11,7 @@
  * @author  Michael Slusarz <slusarz@horde.org>
  * @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
index 5a04696..e29dfcb 100644 (file)
@@ -10,6 +10,6 @@
  * @author  Michael Slusarz <slusarz@horde.org>
  * @package IMP
  */
-class IMP_Exception extends Horde_Exception
+class IMP_Exception extends Horde_Exception_Prior
 {
 }
index 95a326e..c7ed327 100644 (file)
@@ -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);
index b09553a..b4c5bf4 100644 (file)
@@ -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;
index 62b9bb6..df12f4b 100644 (file)
@@ -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",
index fb43cfb..336bced 100644 (file)
@@ -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'));
index 924bb71..eca7417 100644 (file)
@@ -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';
index a8df59f..e5d275d 100644 (file)
@@ -10,6 +10,6 @@
  * @author  Michael Slusarz <slusarz@horde.org>
  * @package Ingo
  */
-class Ingo_Exception extends Horde_Exception
+class Ingo_Exception extends Horde_Exception_Prior
 {
 }
index 584b7c9..2daba71 100644 (file)
@@ -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) {
index d47346c..9ff3fdb 100644 (file)
@@ -10,6 +10,6 @@
  * @author  Jan Schneider <jan@horde.org>
  * @package Kronolith
  */
-class Kronolith_Exception extends Horde_Exception
+class Kronolith_Exception extends Horde_Exception_Prior
 {
 }
index 7ec48f3..a169d9a 100644 (file)
@@ -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 '<h1>HTTP/1.0 404 Not Found</h1>';
@@ -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 '<h1>HTTP/1.0 404 Not Found</h1>';
@@ -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 '<h1>HTTP/1.0 404 Not Found</h1>';
index 1dd5756..935d6e4 100644 (file)
@@ -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.
index 9780330..ca623f2 100644 (file)
@@ -1,2 +1,2 @@
 <?php
-class Shout_Exception extends Horde_Exception {}
+class Shout_Exception extends Horde_Exception_Prior {}
index 02d35d8..71164df 100644 (file)
@@ -92,12 +92,12 @@ class Skeleton_Driver_Sql extends Skeleton_Driver
         $result = $this->_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.
index e6fa54b..752f550 100644 (file)
@@ -10,6 +10,6 @@
  * @author  Jan Schneider <jan@horde.org>
  * @package Turba
  */
-class Turba_Exception extends Horde_Exception
+class Turba_Exception extends Horde_Exception_Prior
 {
 }