use OpenILS::Application::AppUtils;
use OpenILS::Perm;
use OpenILS::Application::AppUtils;
+use OpenILS::EX;
# memcache handle
my $cache_handle;
"open-ils.storage", $name, $username );
unless(ref($user_list)) {
- throw OpenSRF::EX::ERROR
- ("No user info returned from storage for $username");
+ return OpenILS::EX->new("UNKNOWN_USER")->ex;
}
warn "We have the user from storage with usrname $username\n";
if(!$user or !ref($user) ) {
- throw OpenSRF::EX::ERROR ("No user for $username");
+ return OpenILS::EX->new("UNKNOWN_USER")->ex();
}
my $password = $user->passwd();
DUPLICATE_USER_USERNAME => 5,
USER_WRONG_PASSWORD => 6,
PERMISSION_DENIED => 7,
+ UNKNOWN_USER => 8,
);
use overload ( '""' => sub { $_[0]->ex()->err_msg(); } );
IF type == ex_types.USER_WRONG_PASSWORD;
ret("Password is incorrect"); END;
+ IF type == ex_types.UNKNOWN_USER;
+ ret("User is not recognized"); END;
+
+ ret("Unknown exception occured");
+
-%]