Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.2

Bug #1710 _raiseError() doesn not return a PEAR_Error Object
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)    
Subscription  


 [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.

Comments

 [2004-06-26 16:06 UTC] damian
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Net_Cyrus Version 0.3.0 fixes this