Class: ActionReporter::HoneybadgerReporter

Inherits:
Base
  • Object
show all
Defined in:
lib/action_reporter/honeybadger_reporter.rb

Instance Method Summary collapse

Methods inherited from Base

class_accessor, #resolve_check_in_id, #transform_context

Instance Method Details

#check_in(identifier) ⇒ Object



19
20
21
22
# File 'lib/action_reporter/honeybadger_reporter.rb', line 19

def check_in(identifier)
  check_in_id = resolve_check_in_id(identifier)
  honeybadger_class.check_in(check_in_id)
end

#context(args) ⇒ Object



10
11
12
13
# File 'lib/action_reporter/honeybadger_reporter.rb', line 10

def context(args)
  new_context = transform_context(args)
  honeybadger_class.context(new_context)
end

#current_user=(user) ⇒ Object



24
25
26
# File 'lib/action_reporter/honeybadger_reporter.rb', line 24

def current_user=(user)
  honeybadger_class.context(user_global_id: user.to_global_id.to_s) if user
end

#notify(error, context: {}) ⇒ Object



5
6
7
8
# File 'lib/action_reporter/honeybadger_reporter.rb', line 5

def notify(error, context: {})
  new_context = transform_context(context)
  honeybadger_class.notify(error, context: new_context)
end

#reset_contextObject



15
16
17
# File 'lib/action_reporter/honeybadger_reporter.rb', line 15

def reset_context
  honeybadger_class.context.clear!
end