Module: Robustly::Methods
- Defined in:
- lib/robustly.rb
Instance Method Summary collapse
- #robustly(options = {}, &block) ⇒ Object (also: #yolo)
Instance Method Details
#robustly(options = {}, &block) ⇒ Object Also known as: yolo
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/robustly.rb', line 20 def robustly( = {}, &block) class_names = Array([:only] || StandardError) begin yield rescue *class_names => e raise e if %w[development test].include?(Robustly.env) if [:throttle] ? rand < 1.0 / [:throttle] : true Robustly.report_exception(e) end [:default] end end |