From e282ab35fce809fcfc811c3c2f8faa4e9eb56786 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Sun, 25 Jan 2009 17:11:37 +0000 Subject: 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 --- src/couchdb/couch_doc.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/couchdb') 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), -- cgit v1.2.3