Class: Fluent::MixpanelOutputErrorHandler

Inherits:
Mixpanel::ErrorHandler
  • Object
show all
Defined in:
lib/fluent/plugin/mixpanel_ruby_error_handler.rb

Instance Method Summary collapse

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.message}\n\tBacktrace: #{error.backtrace}"
end