mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-10 21:47:01 +02:00
Improve formatting of hook crashes
This commit is contained in:
parent
629e568294
commit
7a622c3392
|
@ -381,10 +381,13 @@ safe_apply(Hook, Module, Function, Args) ->
|
||||||
apply(Module, Function, Args)
|
apply(Module, Function, Args)
|
||||||
end
|
end
|
||||||
catch ?EX_RULE(E, R, St) when E /= exit; R /= normal ->
|
catch ?EX_RULE(E, R, St) when E /= exit; R /= normal ->
|
||||||
?ERROR_MSG("Hook ~p crashed when running ~p:~p/~p:~n"
|
?ERROR_MSG("Hook ~p crashed when running ~p:~p/~p:~n" ++
|
||||||
"** Reason = ~p~n"
|
string:join(
|
||||||
"** Arguments = ~p",
|
["** Reason = ~p"|
|
||||||
|
["** Arg " ++ integer_to_list(I) ++ " = ~p"
|
||||||
|
|| I <- lists:seq(1, length(Args))]],
|
||||||
|
"~n"),
|
||||||
[Hook, Module, Function, length(Args),
|
[Hook, Module, Function, length(Args),
|
||||||
{E, R, ?EX_STACK(St)}, Args]),
|
{E, R, ?EX_STACK(St)}|Args]),
|
||||||
'EXIT'
|
'EXIT'
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user