Home » Authentication » LiveUser_Admin » Bug #5690
unnessecary exception thrown
Details
| 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) |
Comments
[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.