SOMError
This functions handles an error condition.
Syntax
int errorCode; string fileName; int lineNum; SOMError(errorCode, fileName, lineNum);
Parameters
- errorCode (int)
- An integer representing the error code of the error.
- fileName (string)
- The name of the file in which the error occurred.
- lineNum (int)
- The line number where the error occurred.
Return Code
Remarks
This function inspects the specified error code and takes appropriate action, depending on the severity of the error. The last digit of the error code indicates whether the error is classified as SOM_Fatal (9), SOM_Warn (2), or SOM_Ignore (1). The default implementation of this function prints a message that includes the specified error code, filename, and line number, and terminates the current process if the error is classified as SOM_Fatal. The fileName and lineNum arguments specify where the error occurred. This routine can be replaced by changing the value of the global variable SOMError.
For C and C++ programmers, SOM defines a convenience macro, SOM_Error, which invokes this function and supplies the last two arguments.