lib/em-dextras/chains.rb in em-dextras-0.3.0 vs lib/em-dextras/chains.rb in em-dextras-0.4.0

- old
+ new

@@ -159,9 +159,17 @@ pipe_setup.result.fail(*values) end end def self.call(stage, input, pipe_setup) + begin + do_call stage, input, pipe_setup + rescue => e + EMDextras::Chains::Deferrables.failed e + end + end + + def self.do_call(stage, input, pipe_setup) todo_method = stage.method(:todo) arity = todo_method.arity if arity < 0 && pipe_setup.options[:context] stage.todo(input, pipe_setup.options[:context]) elsif arity < 0 || arity == 1