Log slightly less information on errors

Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/15e8ea68
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/15e8ea68
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/15e8ea68

Branch: refs/heads/import
Commit: 15e8ea6832db6e430868e5e740890fa6b32ac320
Parents: 2ef6d47
Author: Robert Newson <[email protected]>
Authored: Tue Mar 5 15:25:54 2013 -0600
Committer: Robert Newson <[email protected]>
Committed: Tue Mar 5 20:18:08 2013 -0600

----------------------------------------------------------------------
 src/chttpd.erl | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/15e8ea68/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 290d7c6..59485f5 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -222,8 +222,7 @@ handle_request(MochiReq) ->
             {ok, Resp0};
         throw:{http_abort, Resp0, Reason0} ->
             {aborted, Resp0, Reason0};
-        throw:{invalid_json, S} ->
-            ?LOG_ERROR("attempted upload of invalid JSON ~s", [S]),
+        throw:{invalid_json, _} ->
             send_error(HttpReq, {bad_request, "invalid UTF-8 JSON"});
         exit:{mochiweb_recv_error, E} ->
             ?LOG_INFO(LogForClosedSocket ++ " - ~p", [E]),
@@ -234,8 +233,8 @@ handle_request(MochiReq) ->
             send_error(HttpReq, database_does_not_exist);
         Tag:Error ->
             Stack = erlang:get_stacktrace(),
-            ?LOG_ERROR("Uncaught error in HTTP request: ~p",[{Tag, Error}]),
-            ?LOG_INFO("Stacktrace: ~p",[Stack]),
+            ?LOG_ERROR("~p ~p ~p ~p", [?MODULE, Tag, Error,
+                json_stack(Error, nill, Stack)]),
             send_error(HttpReq, {Error, nil, Stack})
     end,
 

Reply via email to