Module: Excom::Plugins::Rescue
- Defined in:
- lib/excom/plugins/rescue.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/excom/plugins/rescue.rb', line 5 def error @error end |
Instance Method Details
#error? ⇒ Boolean
23 24 25 |
# File 'lib/excom/plugins/rescue.rb', line 23 def error? status == :error end |
#execute(**opts) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/excom/plugins/rescue.rb', line 12 def execute(**opts) rezcue = opts.delete(:rescue) super rescue StandardError => error clear_execution_state! @error = error @status = :error raise error unless rezcue self end |
#initialize_clone ⇒ Object
7 8 9 10 |
# File 'lib/excom/plugins/rescue.rb', line 7 def initialize_clone(*) remove_instance_variable('@error') if defined?(@error) super end |