Updated Branches:
  refs/heads/1.1.x 47491b7f0 -> 31282b5de

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/31282b5d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/31282b5d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/31282b5d

Branch: refs/heads/1.1.x
Commit: 31282b5de0728fe1bb1f7d37f883969ea358977d
Parents: 47491b7
Author: Randall Leeds <rand...@apache.org>
Authored: Fri Mar 23 12:36:34 2012 -0700
Committer: Randall Leeds <rand...@apache.org>
Committed: Fri Mar 23 12:38:39 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/31282b5d/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 1715b81..7d9c36f 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -751,8 +751,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) ->

Reply via email to