From a589518053c2893dead28fd159ef3d9e48585cf4 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 16 Sep 2013 17:52:27 +0200 Subject: [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. --- lib/inets/src/http_server/httpd_request_handler.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/inets/src') diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl index 2e4a35d031..ea7a17e40d 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). -- cgit v1.2.3