Class: Exceptions::Backend
- Inherits:
-
Object
- Object
- Exceptions::Backend
- Defined in:
- lib/exceptions/backend.rb
Overview
Public: Backend is an abstract class that documents the interface for an exception tracking backend.
Direct Known Subclasses
Exceptions::Backends::Honeybadger, Exceptions::Backends::Logger, Exceptions::Backends::Multi, Exceptions::Backends::Null, Exceptions::Backends::Raiser
Instance Method Summary collapse
-
#clear_context ⇒ Object
Public: Clear should clear the context.
-
#context(ctx) ⇒ Object
Public: Context can be used to set global context.
-
#notify(exception) ⇒ Object
Public: Notify should be implemented by classes that inherit from Backend to do something with the exception.
-
#rack_exception(exception, env) ⇒ Object
Public: Called by the Rack middleware when an exception is raised.
Instance Method Details
#clear_context ⇒ Object
Public: Clear should clear the context.
Returns nothing.
29 30 |
# File 'lib/exceptions/backend.rb', line 29 def clear_context end |
#context(ctx) ⇒ Object
Public: Context can be used to set global context.
ctx - A Hash of contextual information.
Returns nothing.
23 24 |
# File 'lib/exceptions/backend.rb', line 23 def context(ctx) end |
#notify(exception) ⇒ Object
Public: Notify should be implemented by classes that inherit from Backend to do something with the exception. Implementers of this interface can optionally return a Result object which can include things like an exception id from an external service.
exception - An Exception object. options - A Hash of options.
Returns an object satisfying the Result interface.
14 15 16 |
# File 'lib/exceptions/backend.rb', line 14 def notify(exception) raise NotImplementedError end |
#rack_exception(exception, env) ⇒ Object
Public: Called by the Rack middleware when an exception is raised.
Returns and object satisfying the Result interface.
35 36 37 |
# File 'lib/exceptions/backend.rb', line 35 def rack_exception(exception, env) notify(exception) end |