Class: SuperPoller::ErrorReporter
- Inherits:
-
Object
- Object
- SuperPoller::ErrorReporter
- Defined in:
- lib/super_poller/error_reporter.rb
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(message_handler, error_handler = nil, &block) ⇒ ErrorReporter
constructor
A new instance of ErrorReporter.
Constructor Details
#initialize(message_handler, error_handler = nil, &block) ⇒ ErrorReporter
Returns a new instance of ErrorReporter.
2 3 4 5 |
# File 'lib/super_poller/error_reporter.rb', line 2 def initialize(, error_handler = nil, &block) @message_handler = @error_handler = error_handler || block end |
Instance Method Details
#call(*args) ⇒ Object
7 8 9 10 11 |
# File 'lib/super_poller/error_reporter.rb', line 7 def call(*args) @message_handler.call(*args) rescue StandardError => e @error_handler.call(e, *args) end |