Module: ActiveAgent::Rescue
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveSupport::Rescuable
- Included in:
- Base
- Defined in:
- lib/active_agent/concerns/rescue.rb
Overview
Provides exception handling for action prompts using ‘rescue_from` declarations.
Handler methods must be public or protected because ActiveSupport::Rescuable uses ‘Kernel#method()` for lookup.
Instance Method Summary collapse
-
#handle_exceptions { ... } ⇒ Object
Yields to block with exception handling.
Instance Method Details
#handle_exceptions { ... } ⇒ Object
Yields to block with exception handling. Rescues using registered handlers or re-raises.
34 35 36 37 38 |
# File 'lib/active_agent/concerns/rescue.rb', line 34 def handle_exceptions yield rescue Exception => exception rescue_with_handler(exception) || raise end |