dp4_error_status()

Purpose

Check whether the preceding call to a DP4 interface function encountered an error.

Syntax

int dp4_error_status(const CONN *conn,int *error_level, int *error_nr,int *error_p0,int *error_p1);

Parameters

CONN * conn

Handle to DP4 connection for which the error status is to be checked

 

int * error_level

Pointer to variable which receives the error level

 

int * error_level

Pointer to variable which receives the error number

 

int * p0
int * p1

Pointer to variables which receive the additional error parameters

Description

The function dp4_error_status() is used to check the error status of a DP4 connection. This function must be called immediately after a DP4 API has been called, and before any further DP4 APIs are called, otherwise at least part of the error information will be lost: the error_level information is updated after every call to a DP4DBAPI function that accesses the database manager, and the stored error level is set to 0 if such a call succeeds. (However, the error number and additional parameters are only updated when an error is encountered.)

The exit code is passed back to the operating system, so that programs calling the function dp4_error_status() can be used in batch files, and in other applications where the exit code is required.

Return values

Returns the same value as is placed in *error_level, in other words a non zero return value indicates that the last call to the DP4 database interface encountered an error.

See also

Error handling with DP4DBAPI