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

Bug #5690 unnessecary exception thrown
Submitted: 2005-10-14 10:59 UTC
From: jeroen at terena dot nl Assigned: lsmith
Status: Closed Package: LiveUser_Admin
PHP Version: 5.0.5 OS: debian
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-14 10:59 UTC] jeroen at terena dot nl
Description: ------------ inside LiverUser/Admin.php the function _getUsersByPerm() throws an exception when no users were found. Test script: --------------- $filters = array(); $filters['auth_user_id'] = 'somecrazyemailthatdontexisst@example.com'; $user = $lu_admin->getUsers('perm', $filters, true); IMHO you don't need an error/esception here as no results are not an error, just expected behaviour. I'd simple cut out the error raising bit: $permUsers = $this->perm->getUsers($permFilter); if (!$permUsers) { return false; } Expected result: ---------------- just $user set to false, or perhaps an empty array. Actual result: -------------- $user = false AND an exception/Pear_Errorstack is thrown with code LIVEUSER_ADMIN_ERROR This isn't a very specific error which makes it even harder to anticipate.

Comments

 [2005-10-14 23:18 UTC] lsmith
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.