diff options
author | Micael Karlberg <[email protected]> | 2013-09-16 17:52:27 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2013-11-12 18:24:47 +0100 |
commit | a589518053c2893dead28fd159ef3d9e48585cf4 (patch) | |
tree | 759726a6b88315a093398392349045c463968867 | |
parent | 1b39c3289665b82d0dd8d3d232bc9de1d7fb5237 (diff) | |
download | otp-a589518053c2893dead28fd159ef3d9e48585cf4.tar.gz otp-a589518053c2893dead28fd159ef3d9e48585cf4.tar.bz2 otp-a589518053c2893dead28fd159ef3d9e48585cf4.zip |
[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.erl | 5 |
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..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). |