24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-18 22:15:20 +02:00

Provide stacktrace in log report when a transaction fails

This commit is contained in:
Badlop 2010-12-30 13:47:15 +01:00
parent ff455f1a42
commit 9cbf08700d

View File

@ -551,7 +551,10 @@ transaction(Host, Tab, Fun) ->
{atomic, _} = Good ->
Good;
{aborted, Reason} = Bad ->
?ERROR_MSG("Transaction failed for host ~p in tab ~p with fun ~p:~n~p", [Host, Tab, Fun, Reason]),
Stacktrace = erlang:get_stacktrace(),
?ERROR_MSG("Transaction failed for host ~p in tab ~p with fun ~p:"
"~nReason: ~p~nStacktrace: ~p",
[Host, Tab, Fun, Reason, Stacktrace]),
Bad
end.
transaction2(Host, Tab, Fun) ->