summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-01-25 17:11:37 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-01-25 17:11:37 +0000
commite282ab35fce809fcfc811c3c2f8faa4e9eb56786 (patch)
tree6c3fb0c5c5de32ebbd75751eb866f6aa9bdca880 /src
parentceb625242d53f52680021fa619fd7f104e091722 (diff)
more informative error message on a bad json document
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@737538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_doc.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/couchdb/couch_doc.erl b/src/couchdb/couch_doc.erl
index 3e0a8614..db1f2625 100644
--- a/src/couchdb/couch_doc.erl
+++ b/src/couchdb/couch_doc.erl
@@ -145,7 +145,10 @@ from_json_obj({Props}) ->
deleted = proplists:get_value(<<"_deleted">>, Props, false),
body = NewBody,
attachments = Bins
- }.
+ };
+
+from_json_obj(Other) ->
+ throw({invalid_json_object, "Document must be a JSON object"}).
to_doc_info(FullDocInfo) ->
{DocInfo, _Path} = to_doc_info_path(FullDocInfo),