Class: DaemonKit::ErrorHandlers::Base
- Defined in:
- lib/daemon_kit/error_handlers/base.rb
Overview
Error handlers in DaemonKit are used by the #Safety class. Any error handler has to support the interface provided by this class. It’s also required that safety handlers implement a singleton approach (handled by default by #Base).
Direct Known Subclasses
Class Method Summary collapse
-
.inherited(child) ⇒ Object
When we’re inherited, immediately register the handler with the safety net.
- .instance ⇒ Object
Instance Method Summary collapse
-
#handle_exception(exception) ⇒ Object
Error handlers should overwrite this method and implement their own reporting method.
Class Method Details
.inherited(child) ⇒ Object
When we’re inherited, immediately register the handler with the safety net
20 21 22 |
# File 'lib/daemon_kit/error_handlers/base.rb', line 20 def inherited( child ) #:nodoc: Safety.register_error_handler( child ) end |
.instance ⇒ Object
13 14 15 |
# File 'lib/daemon_kit/error_handlers/base.rb', line 13 def instance @instance ||= new end |
Instance Method Details
#handle_exception(exception) ⇒ Object
Error handlers should overwrite this method and implement their own reporting method.
27 28 29 |
# File 'lib/daemon_kit/error_handlers/base.rb', line 27 def handle_exception( exception ) raise NoMethodError, "Error handler doesn't support #handle_exception" end |