Home » Networking » Net_Cyrus » Bug #1710
_raiseError() doesn not return a PEAR_Error Object
Details
| Submitted | 2004-06-23 22:21 UTC |
|---|---|
| From | alejandro at todomexico dot com |
| Assigned | damian |
| Status | Closed |
| Package | Net_Cyrus |
| PHP Version | 4.2.0 |
| OS | Linux |
| 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.