1-42 SOMobjects Base Toolkit: Programmer’s Reference Manual
SOMError Function
Purpose
Handles an error condition.
Syntax
void (*SOMError) (int errorCode, string fileName, int lineNum);
Description
The SOMError 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 SOMError 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 the SOMError function and supplies the last two arguments.
Parameters
errorCode An integer representing the error code of the error.
fileName The name of the file in which the error occurred.
lineNum The line number where the error occurred.
Related Information
Macros: SOM_Test, SOM_TestC, SOM_WarnMsg, SOM_Assert, SOM_Expect,
SOM_Error
Commenti su questo manuale