Module: ServiceObjects::Helpers::Exceptions
Overview
Note:
A target class should include the module
Features for escaping from runtime errors
Instance Method Summary collapse
-
#escape { ... } ⇒ Object
Re-raises standard errors as
ServiceObjects::Invalid.
Methods included from Messages
#add_message, #messages, #translate
Instance Method Details
#escape { ... } ⇒ Object
Re-raises standard errors as ServiceObjects::Invalid
Mutates the current object by adding error messages
38 39 40 41 42 43 |
# File 'lib/service_objects/helpers/exceptions.rb', line 38 def escape yield if block_given? rescue => error error raise Invalid.new(self) end |