Sha256: c9db64ff383e26c2462e54146af716306b73b0c43800ad2ebd563cf5bf7f4c95

Contents?: true

Size: 540 Bytes

Versions: 1

Compression:

Stored size: 540 Bytes

Contents

module Fluxo
  module Errors
    # @param result [Fluxo::Result] The result to be checked
    def self.raise_operation_error!(result)
      raise result if result.is_a?(Exception)
      raise result.value if result.operation.class.strict?

      [SyntaxError, ArgumentError, NoMethodError, Fluxo::Error].each do |exception|
        raise result.value if result.value.is_a?(exception)
      end
    end
  end

  class Error < StandardError
  end

  class InvalidResultError < Error
  end

  class ValidationDefinitionError < Error
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluxo-0.3.0 lib/fluxo/errors.rb