couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [1/3] git commit: COUCHDB-1406 - Don't attempt to encode invalid json
Date Wed, 08 Feb 2012 18:42:50 GMT
Updated Branches:
  refs/heads/1.1.x 963d7f728 -> 785d32f38
  refs/heads/1.2.x ee2b9218c -> 34d08c0ab
  refs/heads/master a4be68522 -> a7c534437


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

Branch: refs/heads/master
Commit: a7c5344371a4bd8123887291411fbc7b564b8513
Parents: a4be685
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:24 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/a7c53443/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index f838b64..8b05076 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -325,7 +325,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