mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Don't crash on most common gen_server:call errors
This commit is contained in:
parent
b662ec2a78
commit
6b8bc811ac
@ -580,8 +580,13 @@ sql_query_internal(#sql_query{} = Query) ->
|
||||
sqlite ->
|
||||
sqlite_sql_query(Query)
|
||||
end
|
||||
catch
|
||||
Class:Reason ->
|
||||
catch exit:{timeout, _} ->
|
||||
{error, <<"timed out">>};
|
||||
exit:{killed, _} ->
|
||||
{error, <<"killed">>};
|
||||
exit:{normal, _} ->
|
||||
{error, <<"terminated unexpectedly">>};
|
||||
Class:Reason ->
|
||||
ST = erlang:get_stacktrace(),
|
||||
?ERROR_MSG("Internal error while processing SQL query: ~p",
|
||||
[{Class, Reason, ST}]),
|
||||
|
@ -682,6 +682,8 @@ inherit_session_state(#{user := U, server := S,
|
||||
{error, <<"Previous session PID is dead">>};
|
||||
exit:{normal, _} ->
|
||||
{error, <<"Previous session PID has exited">>};
|
||||
exit:{killed, _} ->
|
||||
{error, <<"Previous session PID has been killed">>};
|
||||
exit:{timeout, _} ->
|
||||
ejabberd_sm:close_session(OldSID, U, S, R),
|
||||
ejabberd_c2s:stop(OldPID),
|
||||
|
Loading…
Reference in New Issue
Block a user