Class: Dry::Transaction::StepAdapters::Try Private
- Inherits:
-
Object
- Object
- Dry::Transaction::StepAdapters::Try
- Defined in:
- lib/dry/transaction/step_adapters/try.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
Instance Method Details
#call(step, *args, input) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 9 10 11 12 13 14 |
# File 'lib/dry/transaction/step_adapters/try.rb', line 6 def call(step, *args, input) unless step.[:catch] raise ArgumentError, "+try+ steps require one or more exception classes provided via +catch:+" end Right(step.operation.call(*args, input)) rescue *Array(step.[:catch]) => e Left(e) end |