mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
set the error callback to a nice default in case nobody set an error callback and an error happens
This commit is contained in:
parent
a92c707895
commit
9af4258186
2 changed files with 8 additions and 1 deletions
|
@ -108,7 +108,7 @@ module ActionController
|
|||
|
||||
class Buffer < ActionDispatch::Response::Buffer #:nodoc:
|
||||
def initialize(response)
|
||||
@error_callback = nil
|
||||
@error_callback = lambda { true }
|
||||
super(response, SizedQueue.new(10))
|
||||
end
|
||||
|
||||
|
|
|
@ -313,4 +313,11 @@ module ActionController
|
|||
assert_equal 304, @response.status.to_i
|
||||
end
|
||||
end
|
||||
|
||||
class BufferTest < ActionController::TestCase
|
||||
def test_nil_callback
|
||||
buf = ActionController::Live::Buffer.new nil
|
||||
assert buf.call_on_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue