Class: Barbeque::ExceptionHandler::Sentry

Inherits:
Object
  • Object
show all
Defined in:
lib/barbeque/exception_handler.rb

Instance Method Summary collapse

Constructor Details

#initializeSentry

Returns a new instance of Sentry.



56
57
58
# File 'lib/barbeque/exception_handler.rb', line 56

def initialize
  ::Sentry.get_current_hub.push_scope
end

Instance Method Details

#clear_contextObject



60
61
62
63
# File 'lib/barbeque/exception_handler.rb', line 60

def clear_context
  ::Sentry.get_current_hub.pop_scope
  ::Sentry.get_current_hub.push_scope
end

#handle_exception(e) ⇒ Object

Parameters:

  • e (Exception)


77
78
79
# File 'lib/barbeque/exception_handler.rb', line 77

def handle_exception(e)
  ::Sentry.capture_exception(e)
end

#set_message_context(message_id, message_type) ⇒ Object

Parameters:

  • message_id (String)
  • message_type (String, nil)


67
68
69
70
71
72
73
74
# File 'lib/barbeque/exception_handler.rb', line 67

def set_message_context(message_id, message_type)
  ::Sentry.configure_scope do |scope|
    scope.set_tags(
      message_id: message_id,
      message_type: message_type
    )
  end
end