From 1a0f0688bb2257c6db8e8a3f41b9a41641c2db3f Mon Sep 17 00:00:00 2001 From: IƱaki Baz Castillo Date: Mon, 28 Dec 2009 15:46:26 -0800 Subject: clarify errors when listeners fail to bind When using multiple listeners, the log messages can be potentially misleading as to which listener fails to bind: Before: INFO -- : unlinking existing socket=/tmp/unicorn.sock INFO -- : listening on addr=/tmp/unicorn.sock fd=3 unicorn/socket_helper.rb:110:in `initialize': Permission denied - bind(2) (Errno::EACCES) After: INFO -- : unlinking existing socket=/tmp/openxdms.sock INFO -- : listening on addr=/tmp/openxdms.sock fd=3 FATAL -- : error adding listener addr=0.0.0.0:84 unicorn/socket_helper.rb:110:in `initialize': Permission denied - bind(2) (Errno::EACCES) --- lib/unicorn.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 71d5994..225e00a 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -306,6 +306,9 @@ module Unicorn "(#{tries < 0 ? 'infinite' : tries} tries left)" sleep(delay) retry + rescue => err + logger.fatal "error adding listener addr=#{address}" + raise err end end -- cgit v1.2.3-24-ge0c7