From 3a47a797e377bc3010d1b167d8b7411d651f4870 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Mon, 5 Oct 2009 15:34:41 +0000 Subject: 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 --- src/couchdb/couch_config_writer.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/couchdb') 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 -- cgit v1.2.3