lib/trailblazer/operation/rescue.rb in trailblazer-2.0.0.beta2 vs lib/trailblazer/operation/rescue.rb in trailblazer-2.0.0.beta3
- old
+ new
@@ -1,9 +1,11 @@
class Trailblazer::Operation
module Rescue
- def self.import!(_operation, import, *exceptions, handler:->(*){}, &block)
+ Noop = ->(*) {}
+
+ def self.import!(_operation, import, *exceptions, handler: Noop, &block)
exceptions = [StandardError] unless exceptions.any?
- handler = Pipetree::DSL::Option.(handler)
+ handler = Option.(handler)
rescue_block = ->(options, operation, *, &nested_pipe) {
begin
res = nested_pipe.call
res.first == ::Pipetree::Flow::Right # FIXME.