From a5f8aeb6da74658f020a11b840a0e0eeb7970f38 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 28 May 2010 01:35:59 +0200 Subject: [PATCH] Handle error response from auth modules (thanks to Eric Liang) --- src/ejabberd_auth.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index 4ee39d15c..30ef97685 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -251,7 +251,16 @@ get_password_with_authmodule(User, Server) -> is_user_exists(User, Server) -> lists:any( fun(M) -> - M:is_user_exists(User, Server) + case M:is_user_exists(User, Server) of + {error, Error} -> + ?ERROR_MSG("The authentication module ~p returned an " + "error~nwhen checking user ~p in server ~p~n" + "Error message: ~p", + [M, User, Server, Error]), + false; + Else -> + Else + end end, auth_modules(Server)). %% Check if the user exists in all authentications module except the module