Module: SOCMaker::ERR

Overview

This sub-module contains some error-functionallity, which is used in different classes via mixins.

Defined Under Namespace

Classes: ConsistenceError, InitError, ProcessingError, YAMLParseError

Instance Method Summary collapse

Instance Method Details

#consistence_error(msg, o = {}) ⇒ Object

Method to raise a consistence error

msg

error message

o

optional info

Raises:



140
141
142
# File 'lib/soc_maker/err.rb', line 140

def consistence_error( msg, o={} )
  raise ConsistenceError.new( msg, o )
end

#consistence_error_if(con, msg, o = {}) ⇒ Object

Method to raise a consistence error if the condition is true

con

condition

msg

error message

o

optional info



149
150
151
152
153
# File 'lib/soc_maker/err.rb', line 149

def consistence_error_if( con, msg, o={} )
  if !!(con)
    consistence_error( msg, o )
  end
end

#init_error(msg, o = {}) ⇒ Object

Method to raise an initialization error

msg

error message

o

optional info

Raises:



193
194
195
# File 'lib/soc_maker/err.rb', line 193

def init_error( msg, o={} )
  raise InitError.new( msg, o )
end

#init_error_if(con, msg, o = {}) ⇒ Object

Method to raise an initialization error if the condition is true

con

condition

msg

error message

o

optional info



202
203
204
205
206
# File 'lib/soc_maker/err.rb', line 202

def init_error_if( con, msg, o={} )
  if !!(con)
    init_error( msg, o )
  end
end

#processing_error(msg, o = {}) ⇒ Object

Method to raise a processing error

msg

error message

o

optional info

Raises:



83
84
85
# File 'lib/soc_maker/err.rb', line 83

def processing_error( msg, o={} )
  raise ProcessingError.new( msg, o )
end

#processing_error_if(res, msg, o = {}) ⇒ Object

Method to raise a processing error if the condition is true

con

condition

msg

error message

o

optional info



92
93
94
95
96
# File 'lib/soc_maker/err.rb', line 92

def processing_error_if( res, msg, o={} )
  if !!(res)
    processing_error( msg, o )
  end
end