Permalink
Browse files

Make the 3rd arg optional for #failsafe_response

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3815 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
technoweenie committed Mar 8, 2006
1 parent 043bee3 commit e320f28945290b527a5634ea473b5a8543d5ab0a
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/lib/dispatcher.rb
@@ -85,13 +85,13 @@ def prepare_breakpoint
end
# If the block raises, send status code as a last-ditch response.
- def failsafe_response(output, status, exception)
+ def failsafe_response(output, status, exception = nil)
yield
rescue Object
begin
output.write "Status: #{status}\r\n"
output.write "Content-Type: text/plain\r\n\r\n"
- output.write exception.to_s + "\r\n" + exception.backtrace.join("\r\n")
+ output.write exception.to_s + "\r\n" + exception.backtrace.join("\r\n") if exception
rescue Object
end
end

0 comments on commit e320f28

Please sign in to comment.