Class: Eventboss::ErrorHandlers::Sentry

Inherits:
Object
  • Object
show all
Defined in:
lib/eventboss/error_handlers/sentry.rb

Instance Method Summary collapse

Constructor Details

#initializeSentry



4
5
6
7
8
9
10
# File 'lib/eventboss/error_handlers/sentry.rb', line 4

def initialize
  warn "[DEPRECATED] Eventboss::ErrorHandlers::Sentry is deprecated. " \
       "Use Eventboss::Sentry::ErrorHandler instead. " \
       "For automatic configuration, require 'eventboss/sentry/configure'. " \
       "This class will be removed in a future version."
  super
end

Instance Method Details

#call(exception, context = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/eventboss/error_handlers/sentry.rb', line 12

def call(exception, context = {})
  eventboss_context = { component: 'eventboss' }
  eventboss_context[:action] = context[:processor].class.to_s if context[:processor]

  ::Sentry.with_scope do |scope|
    scope.set_tags(
      context.merge(eventboss_context)
    )
    ::Sentry.capture_exception(exception)
  end
end