From c73a8da174f846e5fa401a25c47cb452f9a8bca6 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Fri, 7 Jan 2011 11:43:46 +0000 Subject: Merged revision 1056274 from trunk More explicit and helpful file access permission errors Closes COUCHDB-966 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1056275 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_misc_handlers.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/couchdb/couch_httpd_misc_handlers.erl') diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl index 6cc48f51..213cbfd4 100644 --- a/src/couchdb/couch_httpd_misc_handlers.erl +++ b/src/couchdb/couch_httpd_misc_handlers.erl @@ -236,8 +236,12 @@ handle_config_req(Req) -> handle_approved_config_req(#httpd{method='PUT', path_parts=[_, Section, Key]}=Req, Persist) -> Value = couch_httpd:json_body(Req), OldValue = couch_config:get(Section, Key, ""), - ok = couch_config:set(Section, Key, ?b2l(Value), Persist), - send_json(Req, 200, list_to_binary(OldValue)); + case couch_config:set(Section, Key, ?b2l(Value), Persist) of + ok -> + send_json(Req, 200, list_to_binary(OldValue)); + Error -> + throw(Error) + end; % DELETE /_config/Section/Key handle_approved_config_req(#httpd{method='DELETE',path_parts=[_,Section,Key]}=Req, Persist) -> case couch_config:get(Section, Key, null) of -- cgit v1.2.3