Method: Failbot#disable
- Defined in:
- lib/failbot.rb
#disable(&block) ⇒ Object
Public: Disable exception reporting. This is equivalent to calling ‘Failbot.setup(“FAILBOT_REPORT” => 0)`, but can be called after setup.
Failbot.disable do
something_that_might_go_kaboom
end
block - an optional block to perform while reporting is disabled. If a block
is passed, reporting will be re-enabled after the block is called.
373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/failbot.rb', line 373 def disable(&block) original_report_errors = @thread_local_report_errors.value @thread_local_report_errors.value = false if block begin block.call ensure @thread_local_report_errors.value = original_report_errors end end end |