log 500 errors before return them to the client This ensures that the log will contain any nasty errors we haven't caught elsewhere. In particular, related to the previous patch, it ensures that couch_file errors otherwise only logged at debug will log at error unless caught elsewhere.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/205ccb07 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/205ccb07 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/205ccb07 Branch: refs/heads/hotfixes1.2 Commit: 205ccb07114107e6daf7a156764c751e2f9f1571 Parents: 6e3f17a Author: Randall Leeds <rand...@apache.org> Authored: Fri Mar 23 12:36:34 2012 -0700 Committer: Randall Leeds <rand...@apache.org> Committed: Wed Oct 10 15:38:58 2012 -0700 ---------------------------------------------------------------------- src/couchdb/couch_httpd.erl | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/205ccb07/src/couchdb/couch_httpd.erl ---------------------------------------------------------------------- diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 90d5c80..1c080bc 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -809,8 +809,10 @@ error_info({error, illegal_database_name}) -> error_info({missing_stub, Reason}) -> {412, <<"missing_stub">>, Reason}; error_info({Error, Reason}) -> + ?LOG_ERROR("Uncaught server error: ~p", [{Error, Reason}]), {500, couch_util:to_binary(Error), couch_util:to_binary(Reason)}; error_info(Error) -> + ?LOG_ERROR("Uncaught server error: ~p", [Error]), {500, <<"unknown_error">>, couch_util:to_binary(Error)}. error_headers(#httpd{mochi_req=MochiReq}=Req, Code, ErrorStr, ReasonStr) ->