aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-09-28 18:01:35 +0200
committerLoïc Hoguin <[email protected]>2011-09-28 18:01:35 +0200
commiteff94772018b77b969b3a3afe465789c8aa7bef1 (patch)
tree95c5881bd16ac0dd80d2c7d025ca2b11273008bb
parent0e84e7f920d391487dcb056e520fe29491847d0a (diff)
downloadcowboy-eff94772018b77b969b3a3afe465789c8aa7bef1.tar.gz
cowboy-eff94772018b77b969b3a3afe465789c8aa7bef1.tar.bz2
cowboy-eff94772018b77b969b3a3afe465789c8aa7bef1.zip
Improve the error message for HTTP handlers
Making it look more like the websocket handler error messages.
-rw-r--r--src/cowboy_http_protocol.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index 63c971d..fe5f375 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -212,8 +212,10 @@ handler_init(Req, State=#state{listener=ListenerPid,
catch Class:Reason ->
error_terminate(500, State),
error_logger:error_msg(
- "** Handler ~p terminating in init/3 for the reason ~p:~p~n"
- "** Options were ~p~n** Request was ~p~n** Stacktrace: ~p~n~n",
+ "** Handler ~p terminating in 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()])
end.
@@ -224,7 +226,8 @@ handler_loop(HandlerState, Req, State=#state{handler={Handler, Opts}}) ->
next_request(HandlerState2, Req2, State)
catch Class:Reason ->
error_logger:error_msg(
- "** Handler ~p terminating in handle/2 for the reason ~p:~p~n"
+ "** Handler ~p terminating in handle/2~n"
+ " for the reason ~p:~p~n"
"** Options were ~p~n** Handler state was ~p~n"
"** Request was ~p~n** Stacktrace: ~p~n~n",
[Handler, Class, Reason, Opts,
@@ -239,7 +242,8 @@ handler_terminate(HandlerState, Req, #state{handler={Handler, Opts}}) ->
Handler:terminate(Req#http_req{resp_state=locked}, HandlerState)
catch Class:Reason ->
error_logger:error_msg(
- "** Handler ~p terminating in terminate/2 for the reason ~p:~p~n"
+ "** Handler ~p terminating in terminate/2~n"
+ " for the reason ~p:~p~n"
"** Options were ~p~n** Handler state was ~p~n"
"** Request was ~p~n** Stacktrace: ~p~n~n",
[Handler, Class, Reason, Opts,