couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject git commit: Log error on failure writing to the URI file
Date Tue, 01 Nov 2011 20:02:15 GMT
Updated Branches:
  refs/heads/1.2.x 7ae56aee0 -> 805d4503b


Log error on failure writing to the URI file

Report, and most of the work by Rogutės Sparnuotos.
Thanks. Closes COUCHDB-1326.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/805d4503
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/805d4503
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/805d4503

Branch: refs/heads/1.2.x
Commit: 805d4503ba59a3d2ccac5768560a2ccd3facfdd4
Parents: 7ae56ae
Author: Filipe David Manana <fdmanana@apache.org>
Authored: Tue Nov 1 19:53:39 2011 +0000
Committer: Filipe David Manana <fdmanana@apache.org>
Committed: Tue Nov 1 19:57:23 2011 +0000

----------------------------------------------------------------------
 THANKS                           |    1 +
 src/couchdb/couch_server_sup.erl |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/805d4503/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index 714c224..908c60f 100644
--- a/THANKS
+++ b/THANKS
@@ -91,5 +91,6 @@ suggesting improvements or submitting changes. Some of these people are:
  * Christian Carter <cdcarter@gmail.com>
  * Lukasz Mielicki <mielicki@gmail.com>
  * Omar Yasin <omarkj@gmail.com>
+ * Rogutės Sparnuotos <rogutes@googlemail.com>
 
 For a list of authors see the `AUTHORS` file.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/805d4503/src/couchdb/couch_server_sup.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_server_sup.erl b/src/couchdb/couch_server_sup.erl
index ac084f4..7baede3 100644
--- a/src/couchdb/couch_server_sup.erl
+++ b/src/couchdb/couch_server_sup.erl
@@ -119,7 +119,15 @@ start_server(IniFiles) ->
             undefined -> [];
             Uri -> io_lib:format("~s~n", [Uri])
             end end || Uri <- Uris],
-        ok = file:write_file(UriFile, Lines)
+        case file:write_file(UriFile, Lines) of
+        ok -> ok;
+        {error, eacces} ->
+            ?LOG_ERROR("Permission error when writing to URI file ~s", [UriFile]),
+            throw({file_permission_error, UriFile});
+        Error2 ->
+            ?LOG_ERROR("Failed to write to URI file ~s: ~p~n", [UriFile, Error2]),
+            throw(Error2)
+        end
     end,
 
     {ok, Pid}.


Mime
View raw message