Handling Errors

Uniform handling of errors is provided by the Error class.

The Error class provides four static methods, summarized below. From within a primitive definition, it is not necessary to explicitly include the Error.h header file. The class is typically used like this:

Error::abortRun(*this,"this message is displayed");

The notation Error::abortRun is the way static methods are invoked in C++ without having a pointer to an instance of the Error class. The first argument tells the Error class which object is flagging the error; this is strongly recommended. The name of the object will be printed along with the error message. Note that the abortRun call does not cause an immediate halt. It simply marks a flag that the scheduler must test for. After an error insert return;

Class Error

Method

Parameter

Description

static void abortRun (...)

 

signal a fatal error, and request a halt to the run

 

const NamedObj&

the object triggering the error

 

const char*

the error message

 

const char* = 0

optional additional message to concatenate

 

const char* = 0

optional additional message to concatenate

static void abortRun (...)

 

signal a fatal error, and request a halt to the run

 

const char*

the error message

 

const char* = 0

optional additional message to concatenate

 

const char* = 0

optional additional message to concatenate

static void error (...)

same as abortRun

signal an error, without requesting a halt to the run

static void message (...)

same as abortRun

output a message to the user

static void warn (...)

same as abortRun

generate a warning message