Module: Fluxo::Errors

Defined in:
lib/fluxo/errors.rb

Class Method Summary collapse

Class Method Details

.raise_operation_error!(result) ⇒ Object

Parameters:



4
5
6
7
8
9
10
11
# File 'lib/fluxo/errors.rb', line 4

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