Severity of errors

Each Open Server error is associated with a number, a severity level, and a message.

When an error occurs, the currently installed error handler function is called with the error number, error severity level, and the text of the message. If no error handler has been installed, Open Server’s log file records this information. An application can also explicitly write to the log file with a call to srv_log.

An Open Server application can set the log file’s maximum size using srv_props, with the property argument set to SRV_S_LOGSIZE.

Error numbers and severity levels are defined in the header file oserror.h. An application that uses the defined error values must include oserror.h.

Table 2-20 summarizes Open Server error severity levels:

Table 2-20: Severity of errors

Severity

Meaning

Applicable error type

SRV_INFO

An informational error. Most errors are of this severity. This level of severity indicates that an error has occurred but that it is not fatal. It is most often generated by an incorrectly invoking a Server-Library function. For example, calling srv_xferdata to send a row before describing all the columns with srv_descfmt generates a SRV_INFO error.

Open Server application error Client command error

SRV_FATAL_PROCESS

A fatal thread error. The thread that received the error has an internal error from which it cannot recover. For example, the application may have returned from an event without calling srv_senddone. An error of this severity causes Open Server to queue a SRV_DISCONNECT event for the thread, if the thread is a client thread, a SUB-PROC, or a site-handler. Open Server then kills the thread.

Open Server resource error

SRV_FATAL_SERVER

A fatal server error. Open Server has detected an internal error from which it cannot recover. This causes Open Server to queue a SRV_STOP event for the Open Server application, which causes srv_run to return CS_FAIL.

Open Server resource error