aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_websocket.erl
diff options
context:
space:
mode:
authorJames Fish <[email protected]>2015-05-06 16:21:14 +0100
committerJames Fish <[email protected]>2015-05-07 18:43:09 +0100
commit271869889587085494baaedc6b44e939252637f0 (patch)
tree3928c75e4d0ee108a1149290c552ca13217fe50b /src/cowboy_websocket.erl
parent1f5b19a0b791e5eedeb4bd0f8fcaac29e61fb03a (diff)
downloadcowboy-271869889587085494baaedc6b44e939252637f0.tar.gz
cowboy-271869889587085494baaedc6b44e939252637f0.tar.bz2
cowboy-271869889587085494baaedc6b44e939252637f0.zip
Exit with exit/1 on handler exception and include class in reason
Diffstat (limited to 'src/cowboy_websocket.erl')
-rw-r--r--src/cowboy_websocket.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl
index 9ce4f9d..12728d0 100644
--- a/src/cowboy_websocket.erl
+++ b/src/cowboy_websocket.erl
@@ -350,14 +350,15 @@ handler_call(State=#state{handler=Handler}, Req, HandlerState,
websocket_close(State, Req2, HandlerState2, stop)
catch Class:Reason ->
_ = websocket_close(State, Req, HandlerState, {crash, Class, Reason}),
- erlang:Class([
+ exit({cowboy_handler, [
+ {class, Class},
{reason, Reason},
{mfa, {Handler, Callback, 3}},
{stacktrace, erlang:get_stacktrace()},
{msg, Message},
{req, cowboy_req:to_list(Req)},
{state, HandlerState}
- ])
+ ]})
end.
-spec websocket_send(cow_ws:frame(), #state{}) -> ok | stop | {error, atom()}.