summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Leeds <randall@apache.org>2012-03-21 01:42:33 -0700
committerRandall Leeds <randall@apache.org>2012-03-21 01:46:54 -0700
commitcd238b42d1333cece5ab899c35c3b83ada8d448a (patch)
tree182eb011dfad30e69a01de43ff007f6542069aca
parentbb569905aa1781beaf3403c98f4079ea06339451 (diff)
downloadcouchdb-cd238b42d1333cece5ab899c35c3b83ada8d448a.tar.gz
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.
-rw-r--r--src/couchdb/couch_file.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index 7725ddc99..91799330f 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),