PEAR is archived and read-only

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

Home » Authentication » LiveUser_Admin » Bug #5690

unnessecary exception thrown

Details

Submitted2005-10-14 10:59 UTC
Fromjeroen at terena dot nl
Assignedlsmith
StatusClosed
PackageLiveUser_Admin
PHP Version5.0.5
OSdebian
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.