diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2011-01-07 11:43:46 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2011-01-07 11:43:46 +0000 |
commit | c73a8da174f846e5fa401a25c47cb452f9a8bca6 (patch) | |
tree | 75b9293bcfd5c12735597095182c88b82bb98366 /src/couchdb/couch_log.erl | |
parent | b82a37b821b6b943470fcc4476b5530cb48ef4ab (diff) |
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
Diffstat (limited to 'src/couchdb/couch_log.erl')
-rw-r--r-- | src/couchdb/couch_log.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/couchdb/couch_log.erl b/src/couchdb/couch_log.erl index dfd2d178..3b6ce97c 100644 --- a/src/couchdb/couch_log.erl +++ b/src/couchdb/couch_log.erl @@ -65,8 +65,14 @@ init([]) -> end, ets:insert(?MODULE, {level, Level}), - {ok, Fd} = file:open(Filename, [append]), - {ok, {Fd, Level, Sasl}}. + case file:open(Filename, [append]) of + {ok, Fd} -> + {ok, {Fd, Level, Sasl}}; + {error, eacces} -> + {stop, {file_permission_error, Filename}}; + Error -> + {stop, Error} + end. debug_on() -> get_level_integer() =< ?LEVEL_DEBUG. |