25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Log HTTP handler exceptions

This commit is contained in:
Alexey Shchepin 2023-01-26 02:47:34 +03:00
parent 03cbc9b004
commit f650b1e83c

View File

@ -370,7 +370,15 @@ process(Handlers, Request) ->
HandlerModule:socket_handoff(
LocalPath, Request, HandlerOpts);
false ->
try
HandlerModule:process(LocalPath, Request)
catch
Class:Reason:Stack ->
?ERROR_MSG(
"HTTP handler crashed: ~s",
[misc:format_exception(2, Class, Reason, Stack)]),
erlang:raise(Class, Reason, Stack)
end
end,
ejabberd_hooks:run(http_request_debug, [{LocalPath, Request}]),
R;