1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make the 3rd arg optional for #failsafe_response

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3815 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Rick Olson 2006-03-08 14:33:07 +00:00
parent 043bee3338
commit e320f28945

View file

@ -85,13 +85,13 @@ class Dispatcher
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