raiseError() now can accepts a PEAR error object in its first argument. With

this, users can "re-throw" a previously created PEAR error object (very
useful after the use of (push|pop)ErrorHandling)
This commit is contained in:
Tomas V.V.Cox 2001-07-29 04:25:33 +00:00
parent fa75ae3394
commit 1e2d51855c

View file

@ -224,7 +224,7 @@ class PEAR
* handling applied. If the $mode and $options parameters are not
* specified, the object's defaults are used.
*
* @param $message a text error message
* @param $message a text error message or a PEAR error object
* @param $code a numeric error code (it is up to your class
* to define these if you want to use codes)
* @param $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
@ -260,6 +260,14 @@ class PEAR
$error_class = null,
$skipmsg = false)
{
// The error is yet a PEAR error object
if (is_object($message)) {
$code = $message->getCode();
$userinfo = $message->getUserInfo();
$error_class = $message->getType();
$message = $message->getMessage();
}
if ($mode === null) {
if (isset($this) && isset($this->_default_error_mode)) {
$mode = $this->_default_error_mode;