couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [2/3] git commit: COUCHDB-1406 - Don't attempt to encode invalid json
Date Wed, 08 Feb 2012 18:42:50 GMT
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 <rnewson@apache.org>
Authored: Wed Feb 8 18:38:27 2012 +0000
Committer: Robert Newson <rnewson@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"});


Mime
View raw message