summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicael Karlberg <bmk@erlang.org>2013-09-16 17:52:27 +0200
committerIngela Anderton Andin <ingela@erlang.org>2014-02-05 10:32:25 +0100
commit021ede611d20f60e64936763048c271986bb2997 (patch)
tree19ae29e412c32c6fad0feaab60ad8312b47f6ad0
parent260a528990de016d32e80c32fbfbf3ee365df999 (diff)
downloaderlang-021ede611d20f60e64936763048c271986bb2997.tar.gz
[inets/httpd] Improved request handler terminate error-log entry
If a request handler terminates abnormally (terminate reason not normal), the error-log entry was a bit obtuse ("Internal Server Error"). This has been improved so that the log entry now also include the actual terminate reason.
-rw-r--r--lib/inets/src/http_server/httpd_request_handler.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl
index 2e4a35d031..fb458f61cd 100644
--- a/lib/inets/src/http_server/httpd_request_handler.erl
+++ b/lib/inets/src/http_server/httpd_request_handler.erl
@@ -316,7 +316,10 @@ terminate(normal, State) ->
do_terminate(State);
terminate(Reason, #state{response_sent = false, mod = ModData} = State) ->
httpd_response:send_status(ModData, 500, none),
- error_log(httpd_util:reason_phrase(500), ModData),
+ ReasonStr =
+ lists:flatten(io_lib:format("~s - ~p",
+ [httpd_util:reason_phrase(500), Reason])),
+ error_log(ReasonStr, ModData),
terminate(Reason, State#state{response_sent = true, mod = ModData});
terminate(_Reason, State) ->
do_terminate(State).