Exception: Traject::Indexer::ConfigLoadError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/traject/indexer.rb

Overview

Raised by #load_config_file when config file can not be processed.

The exception #message includes an error message formatted for good display to the developer, in the console.

Original exception raised when processing config file can be found in #original. Original exception should ordinarily have a good stack trace, including the file path of the config file in question.

Original config path in #config_file, and line number in config file that triggered the exception in #config_file_lineno (may be nil)

A filtered backtrace just DOWN from config file (not including trace from traject loading config file itself) can be found in

config_file_backtrace

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_file_path, original_exception) ⇒ ConfigLoadError

Returns a new instance of ConfigLoadError.



804
805
806
807
808
809
810
811
812
# File 'lib/traject/indexer.rb', line 804

def initialize(config_file_path, original_exception)
  @original              = original_exception
  @config_file           = config_file_path
  @config_file_lineno    = Traject::Util.backtrace_lineno_for_config(config_file_path, original_exception)
  @config_file_backtrace = Traject::Util.backtrace_from_config(config_file_path, original_exception)
  message                = "Error loading configuration file #{self.config_file}:#{self.config_file_lineno} #{original_exception.class}:#{original_exception.message}"

  super(message)
end

Instance Attribute Details

#config_fileObject (readonly)

We'd have #cause in ruby 2.1, filled out for us, but we want to work before then, so we use our own 'original'



802
803
804
# File 'lib/traject/indexer.rb', line 802

def config_file
  @config_file
end

#config_file_backtraceObject (readonly)

We'd have #cause in ruby 2.1, filled out for us, but we want to work before then, so we use our own 'original'



802
803
804
# File 'lib/traject/indexer.rb', line 802

def config_file_backtrace
  @config_file_backtrace
end

#config_file_linenoObject (readonly)

We'd have #cause in ruby 2.1, filled out for us, but we want to work before then, so we use our own 'original'



802
803
804
# File 'lib/traject/indexer.rb', line 802

def config_file_lineno
  @config_file_lineno
end

#originalObject (readonly)

We'd have #cause in ruby 2.1, filled out for us, but we want to work before then, so we use our own 'original'



802
803
804
# File 'lib/traject/indexer.rb', line 802

def original
  @original
end