Class: Nestene::ExecutionError

Inherits:
Object
  • Object
show all
Includes:
StructureMapper::Hash
Defined in:
lib/nestene/execution_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(exception = nil) ⇒ ExecutionError

Returns a new instance of ExecutionError.



6
7
8
9
10
11
12
13
# File 'lib/nestene/execution_error.rb', line 6

def initialize(exception = nil)

  if exception
    self.message = exception.message
    self.type = exception.class.name
    self.backtrace = exception.backtrace
  end
end

Instance Method Details

#to_exceptionObject



20
21
22
23
24
# File 'lib/nestene/execution_error.rb', line 20

def to_exception
  exception = Nestene.class_from_string(type).new(message)
  exception.set_backtrace self.backtrace
  exception
end