aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_websocket.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-04-01 17:58:04 +0200
committerLoïc Hoguin <[email protected]>2012-04-01 17:58:04 +0200
commitba75e8b8ae5629ea24815f28da944a489bfa0a3e (patch)
treece91177efa909690fb297b8e5403dabe5a120009 /src/cowboy_http_websocket.erl
parent4fb2a6face6e7d6ff1dd34a02c3bd8b63d972624 (diff)
parent5a7040ee1ce1c8413fcf372fd58c2010fcca3795 (diff)
downloadcowboy-ba75e8b8ae5629ea24815f28da944a489bfa0a3e.tar.gz
cowboy-ba75e8b8ae5629ea24815f28da944a489bfa0a3e.tar.bz2
cowboy-ba75e8b8ae5629ea24815f28da944a489bfa0a3e.zip
Merge branch 'log-proplist-req'
Diffstat (limited to 'src/cowboy_http_websocket.erl')
-rw-r--r--src/cowboy_http_websocket.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cowboy_http_websocket.erl b/src/cowboy_http_websocket.erl
index 40fef23..f08405b 100644
--- a/src/cowboy_http_websocket.erl
+++ b/src/cowboy_http_websocket.erl
@@ -130,11 +130,12 @@ handler_init(State=#state{handler=Handler, opts=Opts},
upgrade_denied(Req2)
catch Class:Reason ->
upgrade_error(Req),
+ PLReq = lists:zip(record_info(fields, http_req), tl(tuple_to_list(Req))),
error_logger:error_msg(
"** Handler ~p terminating in websocket_init/3~n"
" for the reason ~p:~p~n** Options were ~p~n"
"** Request was ~p~n** Stacktrace: ~p~n~n",
- [Handler, Class, Reason, Opts, Req, erlang:get_stacktrace()])
+ [Handler, Class, Reason, Opts, PLReq, erlang:get_stacktrace()])
end.
-spec upgrade_error(#http_req{}) -> closed.
@@ -395,13 +396,14 @@ handler_call(State=#state{handler=Handler, opts=Opts}, Req, HandlerState,
{shutdown, Req2, HandlerState2} ->
websocket_close(State, Req2, HandlerState2, {normal, shutdown})
catch Class:Reason ->
+ PLReq = lists:zip(record_info(fields, http_req), tl(tuple_to_list(Req))),
error_logger:error_msg(
"** Handler ~p terminating in ~p/3~n"
" for the reason ~p:~p~n** Message was ~p~n"
"** Options were ~p~n** Handler state was ~p~n"
"** Request was ~p~n** Stacktrace: ~p~n~n",
[Handler, Callback, Class, Reason, Message, Opts,
- HandlerState, Req, erlang:get_stacktrace()]),
+ HandlerState, PLReq, erlang:get_stacktrace()]),
websocket_close(State, Req, HandlerState, {error, handler})
end.
@@ -443,13 +445,14 @@ handler_terminate(#state{handler=Handler, opts=Opts},
try
Handler:websocket_terminate(TerminateReason, Req, HandlerState)
catch Class:Reason ->
+ PLReq = lists:zip(record_info(fields, http_req), tl(tuple_to_list(Req))),
error_logger:error_msg(
"** Handler ~p terminating in websocket_terminate/3~n"
" for the reason ~p:~p~n** Initial reason was ~p~n"
"** Options were ~p~n** Handler state was ~p~n"
"** Request was ~p~n** Stacktrace: ~p~n~n",
[Handler, Class, Reason, TerminateReason, Opts,
- HandlerState, Req, erlang:get_stacktrace()])
+ HandlerState, PLReq, erlang:get_stacktrace()])
end,
closed.