Exception: AppConfigFor::ConfigNotFound

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

Overview

Raised when the configuration could not be found.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locations, original_exception) ⇒ ConfigNotFound

Returns a new instance of ConfigNotFound.



14
15
16
17
18
# File 'lib/app_config_for/errors.rb', line 14

def initialize(locations, original_exception)
  @locations_searched = Array(locations).map { |x| Pathname(x).expand_path }
  @original_exception = original_exception
  super "Could not locate configuration at: #{@locations_searched.join(' or ')}"
end

Instance Attribute Details

#locations_searchedObject (readonly)

The full path of every place the configuration file was looked for.



9
10
11
# File 'lib/app_config_for/errors.rb', line 9

def locations_searched
  @locations_searched
end

#original_exceptionObject (readonly)

The underlying SystemCallError that signaled the missing file. Most commonly this will be Errno::ENOENT.



12
13
14
# File 'lib/app_config_for/errors.rb', line 12

def original_exception
  @original_exception
end