Module: Exceptions

Defined in:
lib/exceptions.rb,
lib/exceptions/result.rb,
lib/exceptions/backend.rb,
lib/exceptions/version.rb,
lib/exceptions/backends.rb,
lib/exceptions/backends/null.rb,
lib/exceptions/configuration.rb,
lib/exceptions/backends/multi.rb,
lib/exceptions/backends/logger.rb,
lib/exceptions/backends/raiser.rb,
lib/exceptions/backends/honeybadger.rb

Defined Under Namespace

Modules: Backends Classes: Backend, BadResult, Configuration, Result

Constant Summary collapse

VERSION =
'0.0.6'

Class Method Summary collapse

Class Method Details

.clear_contextObject

Public: Clear the context.

Returns nothing.



31
32
33
# File 'lib/exceptions.rb', line 31

def clear_context
  backend.clear_context
end

.configurationObject

Public: The configuration object.

Returns a Configuration instance.



45
46
47
# File 'lib/exceptions.rb', line 45

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Public: Configure the configuration.

Yields the Configuration object.

Yields:



52
53
54
# File 'lib/exceptions.rb', line 52

def configure
  yield configuration
end

.context(ctx) ⇒ Object

Public: Set the context.

Returns nothing.



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

def context(ctx)
  backend.context ctx
end

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

Public: Forwards the exception to the configured backend.

exception - An Exception object. options - A Hash of options to pass to the backend.

Returns a Result object.



17
18
19
# File 'lib/exceptions.rb', line 17

def notify(exception, options = {})
  backend.notify exception, options
end

.rack_exception(exception, env) ⇒ Object

Public: Notify a rack exception.

Returns a Result object.



38
39
40
# File 'lib/exceptions.rb', line 38

def rack_exception(exception, env)
  backend.rack_exception exception, env
end