When the DSOM run-time environment encounters an error during execution of a method or procedure, a SYSTEM_EXCEPTION will be raised. The standard system exceptions are discussed in the topic "Exceptions and Error Handling" in Chapter 3 "Using SOM Classes in Client Programs." The "minor" field of the returned exception value will contain a DSOM error code. The DSOM error codes are listed below.
Although a returned exception value can indicate that a DSOM run-time error occurred, it may be difficult for the user or application to determine what caused the error. Consequently, DSOM has been enabled to report run-time error information, for interpretation by IBM support personnel. These error messages take the following form:
DSOM <type> error: <code> [<name>] at <file>:<line>
where the arguments are as follows:
type SYSTEM_EXCEPTION type, code DSOM error code, name symbol for DSOM error code (from "somderr.h"), file source-file name where the error occurred, and line line number where the error occurred.
For example,
DSOM NO_MEMORY error: 30001 [SOMDERROR_NoMemory] at somdobj.c:250
indicates that a "NO_MEMORY" error (error code 30001) occurred in file "somdobj.c" at line 250. This information is not usually meaningful to the user; it provides IBM support personnel with a starting point for problem analysis. There will often be a sequence of error messages; together they indicate the context in which the error occurred. It is important to give all reported messages to IBM support personnel for analysis.
There is an environment variable, SOMDDEBUG, which is used to activate error reporting. There is a corresponding global variable that can be set by an application program; it is declared as:
extern long SOMD_DebugFlag;
Error reporting is normally disabled. To enable error reporting, the environment variable SOMDDEBUG should be set to a value greater than 0. To disable error reporting, SOMDDEBUG should be set to a value less than or equal to 0.
By default, error messages will display on the standard output device. Error messages can also be redirected to a log file. For this, the environment variable SOMDMESSAGELOG should be set to the pathname of the log file. The SOMD_ Init procedure opens the file named in SOMDMESSAGELG (if any), during process initialization.