From 9966df9ad4ddf74111d8cbffb6658497319a89b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 10 Aug 2016 17:45:28 +0200 Subject: Let the stream handler take care of crash handling and logging --- src/cowboy_loop.erl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/cowboy_loop.erl') diff --git a/src/cowboy_loop.erl b/src/cowboy_loop.erl index 0db56db..8acf896 100644 --- a/src/cowboy_loop.erl +++ b/src/cowboy_loop.erl @@ -115,16 +115,8 @@ call(Req, State, Handler, HandlerState, Message) -> {stop, Req2, HandlerState2} -> terminate(Req2, State, Handler, HandlerState2, stop) catch Class:Reason -> - Stacktrace = erlang:get_stacktrace(), cowboy_handler:terminate({crash, Class, Reason}, Req, HandlerState, Handler), - exit({cowboy_handler, [ - {class, Class}, - {reason, Reason}, - {mfa, {Handler, info, 3}}, - {stacktrace, Stacktrace}, - {req, Req}, - {state, HandlerState} - ]}) + erlang:raise(Class, Reason, erlang:get_stacktrace()) end. terminate(Req, #state{env=Env, timeout_ref=TRef}, -- cgit v1.2.3