PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Networking » Net_Cyrus » Bug #1710

_raiseError() doesn not return a PEAR_Error Object

Details

Submitted2004-06-23 22:21 UTC
Fromalejandro at todomexico dot com
Assigneddamian
StatusClosed
PackageNet_Cyrus
PHP Version4.2.0
OSLinux
Roadmaps(Not assigned)

Comments

[2004-06-23 22:21 UTC] alejandro at todomexico dot com

Description:
------------

Function _raiseError() should return a PEAR_Error object, it doesn't, so, functions that depend on this function does not report errors.

function _raiseError($msg, $code)
{
include_once 'PEAR.php';
PEAR::raiseError($msg, $code);
}

Reproduce code:
---------------
Example: I want to catch some errors...

$ret = $cyrus->renameUser('UserThatDontExist', 'UserThatExist');
if(PEAR::isError($ret)) {
echo $ret->getMessage()
}

Due the fact that _raiseError() does´t return an error, the error does not propagate to this function.

Expected result:
----------------
A PEAR_Error object when an error ocurrs.
This fixed the problem for me.

function _raiseError($msg, $code)
{
include_once 'PEAR.php';
return PEAR::raiseError($msg, $code);
}

Actual result:
--------------
Nothing is returned when an error occurs.