summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-10-05 15:34:41 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-10-05 15:34:41 +0000
commit3a47a797e377bc3010d1b167d8b7411d651f4870 (patch)
tree75c3c9123254fe1fab019e58c0792019f970700c /src/couchdb
parent93bc21dbaab3428f5c6cc29d4171c0479ddcdca6 (diff)
friendlier error message on bad log config file permissions
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@821856 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_config_writer.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/couchdb/couch_config_writer.erl b/src/couchdb/couch_config_writer.erl
index 4a859f8d..55e76a84 100644
--- a/src/couchdb/couch_config_writer.erl
+++ b/src/couchdb/couch_config_writer.erl
@@ -55,7 +55,10 @@ save_to_file({{Section, Option}, Value}, File) ->
NewFileContents2
end,
- ok = file:write_file(File, list_to_binary(NewFileContents)),
+ case file:write_file(File, list_to_binary(NewFileContents)) of
+ ok -> ok;
+ _Else -> throw({permissions_error, <<"Config file is not writeable.">>})
+ end,
ok.
%% @doc Iterates over the lines of an ini file and replaces or adds a new