You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/01/17 22:37:06 UTC
[12/50] git commit: Log slightly less information on errors
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 <ro...@cloudant.com>
Authored: Tue Mar 5 15:25:54 2013 -0600
Committer: Robert Newson <ro...@cloudant.com>
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,