couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject [1/2] git commit: no really, I was mostly right
Date Wed, 21 Mar 2012 08:47:39 GMT
Updated Branches:
  refs/heads/1.2.x 3e5ad086c -> cd238b42d


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/cd238b42
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cd238b42
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cd238b42

Branch: refs/heads/1.2.x
Commit: cd238b42d1333cece5ab899c35c3b83ada8d448a
Parents: bb56990
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:46:54 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/cd238b42/src/couchdb/couch_file.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index 7725ddc..9179933 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -274,7 +274,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