Class: Err::Airbrake

Inherits:
Service show all
Defined in:
lib/err/services/airbrake.rb

Class Method Summary collapse

Methods inherited from Service

enabled?, key

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/err/services/airbrake.rb', line 4

def available?
  defined?(::Airbrake)
end

.configure(&block) ⇒ Object



8
9
10
11
# File 'lib/err/services/airbrake.rb', line 8

def configure(&block)
  return unless enabled?
  airbrake.configure(&block)
end

.development_environments=(envs) ⇒ Object



13
14
15
# File 'lib/err/services/airbrake.rb', line 13

def development_environments=(envs)
  config.development_environments = envs.map(&:to_s)
end

.ignore=(exception_names) ⇒ Object



17
18
19
20
# File 'lib/err/services/airbrake.rb', line 17

def ignore=(exception_names)
  config.ignore.clear
  config.ignore.concat exception_names
end

.message(msg, params = {}) ⇒ Object



26
27
28
# File 'lib/err/services/airbrake.rb', line 26

def message(msg, params = {})
  airbrake.notify(msg, parameters: params)
end

.notify(exception, params = {}) ⇒ Object



22
23
24
# File 'lib/err/services/airbrake.rb', line 22

def notify(exception, params = {})
  airbrake.notify_or_ignore(exception, parameters: params)
end