Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 232409C03 for ; Wed, 21 Mar 2012 18:49:49 +0000 (UTC) Received: (qmail 41427 invoked by uid 500); 21 Mar 2012 18:49:49 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 41384 invoked by uid 500); 21 Mar 2012 18:49:48 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 41376 invoked by uid 99); 21 Mar 2012 18:49:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2012 18:49:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5C8D784EA; Wed, 21 Mar 2012 18:49:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randall@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: no really, I was mostly right Message-Id: <20120321184948.5C8D784EA@tyr.zones.apache.org> Date: Wed, 21 Mar 2012 18:49:48 +0000 (UTC) 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 Authored: Wed Mar 21 01:42:33 2012 -0700 Committer: Randall Leeds 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),