Exception: KXI::Exceptions::ConfigurationException

Inherits:
Exception
  • Object
show all
Defined in:
lib/kxi/exceptions/configuration_exception.rb

Overview

Raised on error during configuration file reading

Instance Method Summary collapse

Constructor Details

#initialize(file, path, msg = nil) ⇒ ConfigurationException

Parameters:

  • file (string)

    Path of the configuration file

  • path (string)

    Path of the configuration parameter

  • msg (string, nil) (defaults to: nil)

    Message of error



29
30
31
32
33
34
# File 'lib/kxi/exceptions/configuration_exception.rb', line 29

def initialize(file, path, msg = nil)
	super("Invalid configuration <#{path}> in file '#{file}'!#{msg != nil ? ": #{msg}" : ''}")
	@file = file
	@path = path
	@msg = msg
end

Instance Method Details

#error_messagestring

Gets the message of error

Returns:

  • (string)

    Message of error



21
22
23
# File 'lib/kxi/exceptions/configuration_exception.rb', line 21

def error_message
	@msg
end

#filestring

Gets the path of the configuration file

Returns:

  • (string)

    Path of the configuration file



9
10
11
# File 'lib/kxi/exceptions/configuration_exception.rb', line 9

def file
	@file
end

#pathstring

Gets the path of the configuration parameter

Returns:

  • (string)

    Path of the configuration parameter



15
16
17
# File 'lib/kxi/exceptions/configuration_exception.rb', line 15

def path
	@path
end