2.3. Error Handling

The Cascade Driver implements a mechanism for error reporting that provides as much information as possible from the different product components and layers. Errors can originate from any of the following:

To accomplish this, errors from each of these sources are encoded in groups, to ensure that there can be no ambiguity as to the error source. A base error group number in the thousands (1000-9999) is added to the specific error. For example, all errors generated by the driver are in the range 5001-5999. The following list describes the error categories (see Summary of Reported Errors in the appendices, and the Cogent API header file dr_api.h for a complete list of errors):

Most error sources have an associated table of error descriptions for their group of errors. This is referenced by the API functions to return the appropriate error-string (where available as a parameter).

Errors originating in the driver in many cases provide even more detail, specifying the particular parameter values that caused the error. Driver errors are transferred using the error command format:

(error error_string)

where error_string is as follows:

"error_source error_number (error_time) error_description"

and where:

error_source

The module/function generating the error.

error_number

The error_code described above.

(error_time)

The time of the error, formatted as yymmdd@hh:mm:ss.

error_description

The remainder of the string, providing a detailed explanation of the error.

API functions decode this command to extract the error_string and return it as a parameter. Users of the direct interface may want to perform a similar parsing of the response data on an error condition.