Class: Parallel::ExceptionWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/parallel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ ExceptionWrapper

Returns a new instance of ExceptionWrapper.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/parallel.rb', line 33

def initialize(exception)
  # Remove the bindings stack added by the better_errors gem,
  # because it cannot be marshalled
  if exception.instance_variable_defined? :@__better_errors_bindings_stack
    exception.send :remove_instance_variable, :@__better_errors_bindings_stack
  end

  @exception =
    begin
      Marshal.dump(exception) && exception
    rescue
      UndumpableException.new(exception)
    end
end

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



32
33
34
# File 'lib/parallel.rb', line 32

def exception
  @exception
end