cciGetLastExceptionDataW

Gets diagnostic information about the last exception generated. Information about the last exception generated on the current thread is returned in a CCI_EXCEPTION_WIDE_ST output structure. The user-defined extension can use this function to determine whether any recovery is required when a utility function returns an error code.

This function might be called when a utility function has indicated that an exception occurred by setting returnCode to CCI_EXCEPTION.

Syntax

void* cciGetLastExceptionDataW(
  int*                    returnCode,
  CCI_EXCEPTION_WIDE_ST*  exception_st);

Parameters

returnCode
Receives the return code from the function (output). Possible return codes are:
  • CCI_FATAL_EXCEPTION
  • CCI_RECOVERABLE_EXCEPTION
  • CCI_CONFIGURATION_EXCEPTION
  • CCI_PARSER_EXCEPTION
  • CCI_CONVERSION_EXCEPTION
  • CCI_DATABASE_EXCEPTION
  • CCI_USER_EXCEPTION
  • CCI_UNKNOWN_EXCEPTION
  • CCI_NO_EXCEPTION_EXISTS
  • CCI_INV_DATA_POINTER
exception_st
Specifies the address of a CCI_EXCEPTION_WIDE_ST structure to receive data about the last exception (output).

Return values

None. If an error occurs, the returnCode parameter indicates the reason for the error.

Example

typedef struct exception_wide_st {
  int               versionId;	    /* Structure version identification */
  int               type;          /* Type of exception */
  int               messageNumber; /* Message number */
  int               insertCount;   /* Number of message inserts */
  CCI_STRING_ST     inserts[CCI_MAX_EXCEPTION_INSERTS];
                                   /* Array of message insert areas */
  const char*       fileName;	    /* Source: file name */
  int               lineNumber;	    /* Source: line number in file */
  const char*       functionName;  /* Source: function name */
  CCI_STRING_ST     traceText;	    /* Trace text associated with exception */
  CCI_STRING_ST     objectName;    /* Object name */
  CCI_STRING_ST     objectType;    /* Object type */
} CCI_EXCEPTION_WIDE_ST;


CCI_EXCEPTION_WIDE_ST exception_st = malloc(sizeof(CCI_EXCEPTION_WIDE_ST));
int rc = 0;
memset(&exception_st,0,sizeof(exception_st));
cciGetLastExceptionDataW(&rc, &exception_st);