Exception: AppConfigFor::LoadError

Inherits:
Error
  • Object
show all
Defined in:
lib/app_config_for/errors.rb

Overview

Raised when there was an issue parsing the configuration file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, original_exception) ⇒ LoadError

Returns a new instance of LoadError.



30
31
32
33
34
# File 'lib/app_config_for/errors.rb', line 30

def initialize(file, original_exception)
  @file = Pathname(file).expand_path
  @original_exception = original_exception
  super "Could not load configuration file: #{@file}\n#{@original_exception.message}"
end

Instance Attribute Details

#fileObject (readonly)

The file that was being parsed.



25
26
27
# File 'lib/app_config_for/errors.rb', line 25

def file
  @file
end

#original_exceptionObject (readonly)

The original exception that signaled the parsing problme. Most commonly this will be a Psych::SyntaxError



28
29
30
# File 'lib/app_config_for/errors.rb', line 28

def original_exception
  @original_exception
end