You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2012/02/08 19:42:50 UTC

[2/3] git commit: COUCHDB-1406 - Don't attempt to encode invalid json

COUCHDB-1406 - Don't attempt to encode invalid json


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

Branch: refs/heads/1.2.x
Commit: 34d08c0abd33dc28edac7c6bb2041caafb726fe4
Parents: ee2b921
Author: Robert Newson <rn...@apache.org>
Authored: Wed Feb 8 18:38:27 2012 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Feb 8 18:39:18 2012 +0000

----------------------------------------------------------------------
 src/couchdb/couch_httpd.erl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/34d08c0a/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index b7d0c4a..8f33457 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -324,7 +324,7 @@ handle_request_int(MochiReq, DefaultFun,
         throw:{invalid_json, S} ->
             ?LOG_ERROR("attempted upload of invalid JSON (set log_level to debug to log it)", []),
             ?LOG_DEBUG("Invalid JSON: ~p",[S]),
-            send_error(HttpReq, {bad_request, io_lib:format("invalid UTF-8 JSON: ~p",[S])});
+            send_error(HttpReq, {bad_request, invalid_json});
         throw:unacceptable_encoding ->
             ?LOG_ERROR("unsupported encoding method for the response", []),
             send_error(HttpReq, {not_acceptable, "unsupported encoding"});