From 271869889587085494baaedc6b44e939252637f0 Mon Sep 17 00:00:00 2001 From: James Fish Date: Wed, 6 May 2015 16:21:14 +0100 Subject: Exit with exit/1 on handler exception and include class in reason --- src/cowboy_loop.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cowboy_loop.erl') diff --git a/src/cowboy_loop.erl b/src/cowboy_loop.erl index 8920299..f0b2886 100644 --- a/src/cowboy_loop.erl +++ b/src/cowboy_loop.erl @@ -161,13 +161,14 @@ call(Req, State=#state{resp_sent=RespSent}, cowboy_req:maybe_reply(Stacktrace, Req) end, cowboy_handler:terminate({crash, Class, Reason}, Req, HandlerState, Handler), - erlang:Class([ + exit({cowboy_handler, [ + {class, Class}, {reason, Reason}, {mfa, {Handler, info, 3}}, {stacktrace, Stacktrace}, {req, cowboy_req:to_list(Req)}, {state, HandlerState} - ]) + ]}) end. %% It is sometimes important to make a socket passive as it was initially -- cgit v1.2.3