From 178812e24edc3c912f7c2c13b37ab7f9e41d243c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 11 Oct 2009 01:34:34 -0700 Subject: factor out common listen loop error handling It'll be easier to maintain a common language for logging and debugging. --- lib/rainbows/base.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/rainbows/base.rb') diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index 11c8c7c..da3fff0 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -16,6 +16,12 @@ module Rainbows client.close rescue nil end + # TODO: migrate into Unicorn::HttpServer + def listen_loop_error(e) + logger.error "Unhandled listen loop exception #{e.inspect}." + logger.error e.backtrace.join("\n") + end + # once a client is accepted, it is processed in its entirety here # in 3 easy steps: read request, call app, write app response def process_client(client) -- cgit v1.2.3-24-ge0c7