1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-06 12:00:15 +02:00

fix error handling when sql calling with unknown host.

This commit is contained in:
HAMANO Tsukasa 2014-04-30 15:32:07 +09:00
parent ce22239d85
commit a6408e9281
2 changed files with 2 additions and 1 deletions

View file

@ -212,6 +212,7 @@ is_user_exists(User, Server) ->
true; %% Account exists
{selected, [<<"password">>], []} ->
false; %% Account does not exist
{error, unknownhost} -> false;
{error, Error} -> {error, Error}
catch
_:B -> {error, B}

View file

@ -141,7 +141,7 @@ sql_call(Host, Msg) ->
case get(?STATE_KEY) of
undefined ->
case ejabberd_odbc_sup:get_random_pid(Host) of
none -> ?WARNING_MSG("SQL calling unknown host: ~p~n", [Host]);
none -> {error, unknownhost};
Pid ->
(?GEN_FSM):sync_send_event(Pid,{sql_cmd, Msg, now()},
?TRANSACTION_TIMEOUT)