couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject git commit: restore some log messages after 311d069
Date Mon, 19 Mar 2012 22:55:55 GMT
Updated Branches:
  refs/heads/1.1.x 27783bd17 -> d17388c60


restore some log messages after 311d069


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

Branch: refs/heads/1.1.x
Commit: d17388c608fe93570a4324711ec4086378e8f2fd
Parents: 27783bd
Author: Randall Leeds <randall@apache.org>
Authored: Mon Mar 19 15:54:08 2012 -0700
Committer: Randall Leeds <randall@apache.org>
Committed: Mon Mar 19 15:55:23 2012 -0700

----------------------------------------------------------------------
 src/couchdb/couch_file.erl |    7 ++++++-
 src/couchdb/couch_log.erl  |    6 ++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d17388c6/src/couchdb/couch_file.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index b5eed41..ade018b 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -48,14 +48,19 @@ open(Filepath, Options) ->
     ignore ->
         % get the error
         receive
-        {Ref, Pid, Error} ->
+        {Ref, Pid, {error, Reason} = Error} ->
             case process_info(self(), trap_exit) of
             {trap_exit, true} -> receive {'EXIT', Pid, _} -> ok end;
             {trap_exit, false} -> ok
             end,
+            ?LOG_ERROR("Error opening file ~s: ~s",
+                [Filepath, file:format_error(Reason)]),
             Error
         end;
     Error ->
+        % We can't say much here, because it could be any kind of error.
+        % Just let it bubble and an encapsulating subcomponent can perhaps
+        % be more informative. It will likely appear in the SASL log, anyway.
         Error
     end.
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d17388c6/src/couchdb/couch_log.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_log.erl b/src/couchdb/couch_log.erl
index 397acc7..afe9d20 100644
--- a/src/couchdb/couch_log.erl
+++ b/src/couchdb/couch_log.erl
@@ -82,8 +82,10 @@ init([]) ->
     case file:open(Filename, [append]) of
     {ok, Fd} ->
         {ok, {Fd, Level, Sasl}};
-    Error ->
-        {stop, Error}
+    {error, Reason} ->
+        ReasonStr = file:format_error(Reason),
+        io:format("Error opening log file ~s: ~s", [Filename, ReasonStr]),
+        {stop, {error, ReasonStr, Filename}}
     end.
 
 debug_on() ->


Mime
View raw message