Module: CrashHook

Defined in:
lib/crash_hook.rb,
lib/crash_hook/crash.rb,
lib/crash_hook/errors.rb,
lib/crash_hook/payload.rb,
lib/crash_hook/request.rb,
lib/crash_hook/version.rb,
lib/crash_hook/middleware.rb,
lib/crash_hook/serializer.rb,
lib/crash_hook/configuration.rb

Defined Under Namespace

Modules: Request, Serializer Classes: Configuration, ConfigurationError, Crash, DeliveryError, Error, Middleware, Payload

Constant Summary collapse

VERSION =
"0.2.0".freeze
@@config =
nil

Class Method Summary collapse

Class Method Details

.configure(options) ⇒ Object

Set global configuration



13
14
15
16
# File 'lib/crash_hook.rb', line 13

def self.configure(options)
  @@config = CrashHook::Configuration.new(options)
  @@config
end

.notify(exception, env) ⇒ Object

Manually sent notification

exception => Exception object
env       => Environment hash


22
23
24
25
26
27
# File 'lib/crash_hook.rb', line 22

def self.notify(exception, env)
  if @@config.nil?
    raise CrashHook::ConfigurationError, "No configuration were provided."
  end
  CrashHook::Crash.new(@@config, exception, env).notify
end