couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject git commit: no really, I was mostly right
Date Wed, 21 Mar 2012 18:49:48 GMT
Updated Branches:
  refs/heads/1.1.x d17388c60 -> 9490c55e3


no really, I was mostly right

The errors that come back from the file module are always of the form
{error, Reason}, and Reason is the atom that should be passed to
file:format_error/1.

In one case, couch_file was returning the atom file_exists rather than
comforming to the file module's errors I was expecting.

Returning {error, eexist} is cleaner.


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

Branch: refs/heads/1.1.x
Commit: 9490c55e315205dd41998fe01a8cf2c86cb42407
Parents: d17388c
Author: Randall Leeds <randall@apache.org>
Authored: Wed Mar 21 01:42:33 2012 -0700
Committer: Randall Leeds <randall@apache.org>
Committed: Wed Mar 21 01:44:45 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9490c55e/src/couchdb/couch_file.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index ade018b..0585413 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -264,7 +264,7 @@ init({Filepath, Options, ReturnPid, Ref}) ->
                     {ok, #file{fd=Fd}};
                 false ->
                     ok = file:close(Fd),
-                    init_status_error(ReturnPid, Ref, file_exists)
+                    init_status_error(ReturnPid, Ref, {error, eexist})
                 end;
             false ->
                 maybe_track_open_os_files(Options),


Mime
View raw message