Class: CheckerJobs::Notifiers::Bugsnag

Inherits:
Base
  • Object
show all
Defined in:
lib/checker_jobs/notifiers/bugsnag.rb

Defined Under Namespace

Classes: Error

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(check, count, entries) ⇒ Bugsnag

Returns a new instance of Bugsnag.



4
5
6
7
8
# File 'lib/checker_jobs/notifiers/bugsnag.rb', line 4

def initialize(check, count, entries)
  super

  @formatter = formatter_class.new(check, count, entries)
end

Class Method Details

.default_optionsObject



21
22
23
# File 'lib/checker_jobs/notifiers/bugsnag.rb', line 21

def self.default_options
  { formatter_class: CheckerJobs::Notifiers::BugsnagDefaultFormatter }
end

Instance Method Details

#notifyObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/checker_jobs/notifiers/bugsnag.rb', line 10

def notify
  raise @formatter.base_error
rescue Error => e
  ::Bugsnag.notify(e) do |notification|
    notification.severity = @formatter.severity
    notification.context = @formatter.context
    notification.grouping_hash = @formatter.grouping_hash
    notification.add_tab(*@formatter.tab_infos)
  end
end