Exception: Impostor::ImpostorError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/impostor/errors.rb

Overview

An application error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(e = nil) ⇒ ImpostorError

Creates a new ImpostorError with message and original_exception



16
17
18
19
20
21
# File 'lib/impostor/errors.rb', line 16

def initialize(e = nil)
  exception = e.nil? || e.is_a?(String) ? StandardError.new(e) : e
  @original_exception = exception
  message = "Impostor error: #{exception.message} (#{exception.class})"
  super message
end

Instance Attribute Details

#original_exceptionObject

The original exception



11
12
13
# File 'lib/impostor/errors.rb', line 11

def original_exception
  @original_exception
end