couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject git commit: log 500 errors before return them to the client
Date Fri, 23 Mar 2012 19:38:22 GMT
Updated Branches:
  refs/heads/1.2.x ba8fa8689 -> 688795343


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

Branch: refs/heads/1.2.x
Commit: 6887953432e9ccdef4bb8785b782fc53f6e61602
Parents: ba8fa86
Author: Randall Leeds <randall@apache.org>
Authored: Fri Mar 23 12:36:34 2012 -0700
Committer: Randall Leeds <randall@apache.org>
Committed: Fri Mar 23 12:36:34 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/68879534/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 7f7eb6c..0be7126 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -812,8 +812,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) ->


Mime
View raw message