From e4256da292f9626d7dfca60e08f65651a0a9139a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Nov 2009 00:23:19 +0000 Subject: raise Unicorn::ClientShutdown if client aborts in TeeInput Leaving the EOFError exception as-is bad because most applications/frameworks run an application-wide exception handler to pretty-print and/or log the exception with a huge backtrace. Since there's absolutely nothing we can do in the server-side app to deal with clients prematurely shutting down, having a backtrace does not make sense. Having a backtrace can even be harmful since it creates unnecessary noise for application engineers monitoring or tracking down real bugs. --- lib/unicorn.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index a696402..c6c311e 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -8,6 +8,12 @@ autoload :Rack, 'rack' # a Unicorn web server. It contains a minimalist HTTP server with just enough # functionality to service web application requests fast as possible. module Unicorn + + # raise this inside TeeInput when a client disconnects inside the + # application dispatch + class ClientShutdown < EOFError + end + autoload :Const, 'unicorn/const' autoload :HttpRequest, 'unicorn/http_request' autoload :HttpResponse, 'unicorn/http_response' -- cgit v1.2.3-24-ge0c7