Exception: Terrestrial::LoadError

Inherits:
RuntimeError
  • Object
show all
Includes:
Module.new
Defined in:
lib/terrestrial/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(relation_name, factory, record, original_error) ⇒ LoadError

Returns a new instance of LoadError.



27
28
29
30
31
32
# File 'lib/terrestrial/error.rb', line 27

def initialize(relation_name, factory, record, original_error)
  @relation_name = relation_name
  @factory = factory
  @record = record
  @original_error = original_error
end

Instance Method Details

#messageObject



37
38
39
40
41
42
43
44
# File 'lib/terrestrial/error.rb', line 37

def message
  [
    "Error loading record from `#{relation_name}` relation `#{record.inspect}`.",
    "Using: `#{factory.inspect}`.",
    "Check that the factory is compatible.",
    "Got Error: #{original_error.class.name} #{original_error.message}",
  ].join("\n")
end