couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r731121 - /couchdb/trunk/src/couchdb/couch_httpd.erl
Date Sat, 03 Jan 2009 23:04:56 GMT
Author: jchris
Date: Sat Jan  3 15:04:56 2009
New Revision: 731121

URL: http://svn.apache.org/viewvc?rev=731121&view=rev
Log:
Added decent reporting of Mochiweb start errors (eaddrinuse etc)

Modified:
    couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=731121&r1=731120&r2=731121&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd.erl Sat Jan  3 15:04:56 2009
@@ -55,12 +55,19 @@
         end,
 
     % and off we go
-    {ok, Pid} = mochiweb_http:start([
+    
+    {ok, Pid} = case mochiweb_http:start([
         {loop, Loop},
         {name, ?MODULE},
         {ip, BindAddress},
         {port, Port}
-    ]),
+    ]) of
+    {ok, MochiPid} -> {ok, MochiPid};
+    {error, Reason} ->
+        io:format("Failure to start Mochiweb: ~s~n",[Reason]),
+        throw({error, Reason})
+    end,
+
     ok = couch_config:register(
         fun("httpd", "bind_address") ->
             ?MODULE:stop();



Mime
View raw message