Module: Exceptiontrap

Defined in:
lib/exceptiontrap.rb,
lib/exceptiontrap/data.rb,
lib/exceptiontrap/rack.rb,
lib/exceptiontrap/config.rb,
lib/exceptiontrap/railtie.rb,
lib/exceptiontrap/sidekiq.rb,
lib/exceptiontrap/version.rb,
lib/exceptiontrap/notifier.rb

Overview

Exceptiontrap

Defined Under Namespace

Classes: Config, Data, ExceptiontrapRailtie, Notifier, Rack, SidekiqException

Constant Summary collapse

API_VERSION =
'1'
NOTIFIER_NAME =
'exceptiontrap-rails'
HEADERS =
{
  'Content-type' => 'application/json',
  'Accept' => 'application/json'
}
VERSION =
'2.1.1'

Class Method Summary collapse

Class Method Details

.disabled?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/exceptiontrap.rb', line 36

def self.disabled?
  !enabled?
end

.enabled?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/exceptiontrap.rb', line 32

def self.enabled?
  Config.enabled_environments.include?(Data.application_environment)
end

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

Used by SidekiqException or for manual calls



26
27
28
29
30
# File 'lib/exceptiontrap.rb', line 26

def self.notify(exception, params = {})
  return if disabled?
  data = Data.rack_data(exception, params)
  Notifier.notify(data)
end