Exception: NliPipeline::SystemWrapper::ConfigError

Inherits:
StandardError
  • Object
show all
Includes:
AbstractUtil
Defined in:
lib/nli_pipeline/system_wrapper/config_error.rb

Overview

handles errors for config

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AbstractUtil

#add_attrs, #drop_forbidden_args_message, included, #init_with_attrs, #raise_unless_all

Constructor Details

#initialize(**kwargs) ⇒ ConfigError

wrap up kwargs into single variable error_message



34
35
36
37
38
39
40
# File 'lib/nli_pipeline/system_wrapper/config_error.rb', line 34

def initialize(**kwargs)
  init_with_attrs(**kwargs)
  message = "#{@msg}: #{@config}"
  message += " in #{@file}" if file
  @error_message = message
  super(message)
end

Instance Attribute Details

#error_messageObject (readonly)

Returns the value of attribute error_message.



7
8
9
# File 'lib/nli_pipeline/system_wrapper/config_error.rb', line 7

def error_message
  @error_message
end

Class Method Details

.required_argsArray[Symbol]



22
23
24
# File 'lib/nli_pipeline/system_wrapper/config_error.rb', line 22

def self.required_args
  [:config]
end

.supported_argsHash

static methods required by NliPipeline::AbstractUtil::init_attrs

Returns:

  • (Hash)

See Also:



15
16
17
# File 'lib/nli_pipeline/system_wrapper/config_error.rb', line 15

def self.supported_args
  { config: {}, msg: 'Config Error', file: false }
end

Instance Method Details

#to_sString

override to_s from AbstractUtil return single line summary of error

Returns:

  • (String)


29
30
31
# File 'lib/nli_pipeline/system_wrapper/config_error.rb', line 29

def to_s
  @error_message
end