Method: OpenC3::ConfigParser::Error#initialize

Defined in:
lib/openc3/config/config_parser.rb

#initialize(config_parser, message = "Configuration Error", usage = "", url = "") ⇒ Error

Create an Error with the specified Config data

Parameters:

  • config_parser (ConfigParser)

    Instance of ConfigParser so Error has access to the ConfigParser attributes

  • message (String) (defaults to: "Configuration Error")

    The error message which gets passed to the StandardError constructor

  • usage (String) (defaults to: "")

    The usage string representing how this keyword should be formatted.

  • url (String) (defaults to: "")

    URL which should point to usage information. By default this gets constructed to point to the generic configuration Guide on the OpenC3 Wiki.



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/openc3/config/config_parser.rb', line 127

def initialize(config_parser, message = "Configuration Error", usage = "", url = "")
  if Error === message
    super(message.message)
  elsif Exception === message
    super("#{message.class}: #{message.message}")
  else
    super(message)
  end
  @keyword = config_parser.keyword
  @parameters = config_parser.parameters
  @filename = config_parser.filename
  @line = config_parser.line
  @line_number = config_parser.line_number
  @usage = usage
  @url = url
end