Class: Fluent::MixpanelOutputErrorHandler
- Inherits:
-
Mixpanel::ErrorHandler
- Object
- Mixpanel::ErrorHandler
- Fluent::MixpanelOutputErrorHandler
- Defined in:
- lib/fluent/plugin/mixpanel_ruby_error_handler.rb
Instance Method Summary collapse
- #handle(error) ⇒ Object
-
#initialize(logger) ⇒ MixpanelOutputErrorHandler
constructor
A new instance of MixpanelOutputErrorHandler.
Constructor Details
#initialize(logger) ⇒ MixpanelOutputErrorHandler
Returns a new instance of MixpanelOutputErrorHandler.
4 5 6 |
# File 'lib/fluent/plugin/mixpanel_ruby_error_handler.rb', line 4 def initialize(logger) @logger = logger end |
Instance Method Details
#handle(error) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/fluent/plugin/mixpanel_ruby_error_handler.rb', line 8 def handle(error) # Default behavior is to not return an error. Mixpanel-ruby gem returns # true/false. If there is an error, an optional error handler is called. # In this case, here, we only want to log the error for future development # of error handling. @logger.error "MixpanelOutputErrorHandler:\n\tClass: #{error.class.to_s}\n\tMessage: #{error.}\n\tBacktrace: #{error.backtrace}" end |