Exception: SOCMaker::ERR::InitError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/soc_maker/err.rb

Overview

Initialization errors: occur during the initialization of the classes. A cause for this error could be a wrong structure of the YAML file, for example wrong data types.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, o = {}) ⇒ InitError

This constructor saves the message and optional infos and adds a log entry via SOCMaker::logger.error

message

the error message

o

optional error information



173
174
175
176
177
178
179
# File 'lib/soc_maker/err.rb', line 173

def initialize( message, o={} )
  super message
  @optional = o
  if SOCMaker::logger
    SOCMaker::logger.error( "Initialization Error Raised: #{message}  #{ "\n\t\t" + o.inspect if o.size > 0}" )
  end
end

Instance Attribute Details

#optinalObject (readonly)

Optional error information



166
167
168
# File 'lib/soc_maker/err.rb', line 166

def optinal
  @optinal
end

Instance Method Details

#to_sObject

Returns a string describing this error



183
184
185
# File 'lib/soc_maker/err.rb', line 183

def to_s
  "#{super} #{ "\n\t\t" + @optional.inspect if @optional.size > 0}"
end