couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r821856 - /couchdb/trunk/src/couchdb/couch_config_writer.erl
Date Mon, 05 Oct 2009 15:34:41 GMT
Author: jchris
Date: Mon Oct  5 15:34:41 2009
New Revision: 821856

URL: http://svn.apache.org/viewvc?rev=821856&view=rev
Log:
friendlier error message on bad log config file permissions

Modified:
    couchdb/trunk/src/couchdb/couch_config_writer.erl

Modified: couchdb/trunk/src/couchdb/couch_config_writer.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_config_writer.erl?rev=821856&r1=821855&r2=821856&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_config_writer.erl (original)
+++ couchdb/trunk/src/couchdb/couch_config_writer.erl Mon Oct  5 15:34:41 2009
@@ -55,7 +55,10 @@
             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



Mime
View raw message