diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-12 23:41:30 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-12 23:43:00 -0700 |
commit | 18af4dbcc14eb7765bc021f94a444cc394864c26 (patch) | |
tree | 57a57621024ade521588db1089fae17485d90e86 /lib/unicorn/app/old_rails.rb | |
parent | dc60ca25aa72bcee0becc4cdebb1be67acc5b5b5 (diff) | |
download | unicorn-18af4dbcc14eb7765bc021f94a444cc394864c26.tar.gz |
Hopefully the world will just move to Rack faster so we have less things to worry about.
Diffstat (limited to 'lib/unicorn/app/old_rails.rb')
-rw-r--r-- | lib/unicorn/app/old_rails.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/unicorn/app/old_rails.rb b/lib/unicorn/app/old_rails.rb index bb9577a..4b74666 100644 --- a/lib/unicorn/app/old_rails.rb +++ b/lib/unicorn/app/old_rails.rb @@ -13,9 +13,15 @@ class Unicorn::App::OldRails def call(env) cgi = Unicorn::CGIWrapper.new(env) - Dispatcher.dispatch(cgi, - ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, - cgi.body) + begin + Dispatcher.dispatch(cgi, + ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, + cgi.body) + rescue Object => e + err = env['rack.errors'] + out.write("#{e} #{e.message}\n") + e.backtrace.each { |line| out.write("#{line}\n") } + end cgi.out # finalize the response cgi.rack_response end |