提交 e320f289 编写于 作者: R Rick Olson

Make the 3rd arg optional for #failsafe_response

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3815 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 043bee33
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册