Class: Mediate::ErrorHandler Abstract
- Inherits:
-
Object
- Object
- Mediate::ErrorHandler
- Defined in:
- lib/mediate/error_handler.rb
Overview
This class is abstract.
override #handle to implement.
An abstract base class that handles exceptions raised by request handlers, behaviors, or notification handlers.
Class Method Summary collapse
-
.handles(exception_class = StandardError, dispatched_class = Mediate::Request, mediator = Mediate.mediator) ⇒ void
Registers this to handle exceptions of type exception_class when raised while handling requests or notifications of type dispatched_class.
Instance Method Summary collapse
-
#handle(_dispatched, _exception, _state) ⇒ void
abstract
The method to implement to handle exceptions.
Class Method Details
.handles(exception_class = StandardError, dispatched_class = Mediate::Request, mediator = Mediate.mediator) ⇒ void
This method returns an undefined value.
Registers this to handle exceptions of type exception_class when raised while handling requests or notifications
of type dispatched_class.
23 24 25 |
# File 'lib/mediate/error_handler.rb', line 23 def self.handles(exception_class = StandardError, dispatched_class = Mediate::Request, mediator = Mediate.mediator) mediator.register_error_handler(self, exception_class, dispatched_class) end |
Instance Method Details
#handle(_dispatched, _exception, _state) ⇒ void
This method is abstract.
This method returns an undefined value.
The method to implement to handle exceptions.
40 41 42 |
# File 'lib/mediate/error_handler.rb', line 40 def handle(_dispatched, _exception, _state) raise NoMethodError, "handle must be implemented" end |