From: Jan Schneider Date: Thu, 18 Nov 2010 16:56:37 +0000 (+0100) Subject: Maybe I'm missing something, but wasn't the idea of Horde_Exception to use or X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9e054258bca4c06dfb2333f16d79956f64f295f2;p=horde.git Maybe I'm missing something, but wasn't the idea of Horde_Exception to use or emulate the "previous" feature of PHP 5.3 Exceptions? --- diff --git a/framework/Exception/lib/Horde/Exception/Prior.php b/framework/Exception/lib/Horde/Exception/Prior.php index 37dffb263..a71d948c6 100644 --- a/framework/Exception/lib/Horde/Exception/Prior.php +++ b/framework/Exception/lib/Horde/Exception/Prior.php @@ -22,16 +22,20 @@ class Horde_Exception_Prior extends Horde_Exception */ public function __construct($message = null, $code = 0) { + $previous = null; if (is_object($message) && method_exists($message, 'getMessage')) { if (empty($code) && method_exists($message, 'getCode')) { $code = $message->getCode(); } + if ($message instanceof Exception) { + $previous = $message; + } $message = $message->getMessage(); } - parent::__construct($message, $code); + parent::__construct($message, $code, $previous); } }