Module: MimeActor::Rescue
- Extended by:
- ActiveSupport::Concern
- Includes:
- Validator
- Included in:
- Stage
- Defined in:
- lib/mime_actor/rescue.rb
Overview
# MimeActor Rescue
Simillar to ActionController::Rescue but with additional filtering logic on action/format.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#rescue_actor(error, action:, format:, visited: []) ⇒ Object
Resolve the error provided with the registered handlers.
Instance Method Details
#rescue_actor(error, action:, format:, visited: []) ⇒ Object
Resolve the error provided with the registered handlers.
The handled error will be returned to indicate successful handling.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/mime_actor/rescue.rb', line 75 def rescue_actor(error, action:, format:, visited: []) return if visited.include?(error) visited << error rescuer = find_rescuer(error, format: format, action: action) if (dispatch = MimeActor::Dispatcher.build(rescuer, error, format, action)) dispatch.call(self) error elsif error&.cause rescue_actor(error.cause, format: format, action: action, visited: visited) end end |