Class: DaemonKit::ErrorHandlers::Base

Inherits:
Object
  • Object
show all
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

Hoptoad, Mail

Class Method Summary collapse

Instance Method Summary collapse

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

.instanceObject



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.

Raises:

  • (NoMethodError)


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