Sha256: 0d3037d30b1a46770a4bddc6f8fbe695cfd23e52f1a9fac6381a8723398d2263

Contents?: true

Size: 333 Bytes

Versions: 15

Compression:

Stored size: 333 Bytes

Contents

module Metaractor
  module ChainFailures
    def self.included(base)
      base.class_eval do
        around :chain_nested_failures
      end
    end

    def chain_nested_failures(interactor)
      interactor.call
    rescue Interactor::Failure => e
      context.fail_from_context(context: e.context)
      raise
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
metaractor-3.3.4 lib/metaractor/chain_failures.rb
metaractor-3.3.3 lib/metaractor/chain_failures.rb
metaractor-3.3.2 lib/metaractor/chain_failures.rb
metaractor-3.3.0 lib/metaractor/chain_failures.rb
metaractor-3.2.0 lib/metaractor/chain_failures.rb
metaractor-3.1.1 lib/metaractor/chain_failures.rb
metaractor-3.1.0 lib/metaractor/chain_failures.rb
metaractor-3.0.1 lib/metaractor/chain_failures.rb
metaractor-3.0.0 lib/metaractor/chain_failures.rb
metaractor-2.1.1 lib/metaractor/chain_failures.rb
metaractor-2.1.0 lib/metaractor/chain_failures.rb
metaractor-2.0.0 lib/metaractor/chain_failures.rb
metaractor-1.2.1 lib/metaractor/chain_failures.rb
metaractor-1.2.0 lib/metaractor/chain_failures.rb
metaractor-1.1.0 lib/metaractor/chain_failures.rb