IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

cciGetLastExceptionData

Gets diagnostic information about the last exception generated. Information about the last exception generated on the current thread is returned in a CCI_EXCEPTION_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.

You can call this function when a utility function or user exit callback indicates that an exception has occurred, by setting returnCode to CCI_EXCEPTION.

You must call cciGetLastExceptionData() only when CCI_EXCEPTION is indicated; at other times, the function returns unpredictable results.

The traceText that is associated with the exception converts to a char* if the char* is US-ASCII. If the traceText is in another language, use cciGetLastExceptionDataW and its associated CCI_EXCEPTION_WIDE_ST structure, which stores the traceText as UTF-16.

If the exception has been raised by the broker, or by cciThrowExceptionW, the traceText element of the CCI_EXCEPTION_ST structure is an empty string.

Syntax

void* cciGetLastExceptionData(
  int*               returnCode,
  CCI_EXCEPTION_ST*  exception_st);

Parameters

returnCode
Receives the return code from the function (output). Possible return codes are:
  • CCI_INV_DATA_POINTER
  • CCI_NO_EXCEPTION_EXISTS
  • CCI_EXCEPTION
  • CCI_EXCEPTION_UNKNOWN
  • CCI_EXCEPTION_FATAL
  • CCI_EXCEPTION_RECOVERABLE
  • CCI_EXCEPTION_CONFIGURATION
  • CCI_EXCEPTION_PARSER
  • CCI_EXCEPTION_CONVERSION
  • CCI_EXCEPTION_DATABASE
  • CCI_EXCEPTION_USER
exception_st
Specifies the address of a CCI_EXCEPTION_ST structure to receive data about the last exception (output). The type value returned in the lower four bits of the exception_st.type field is one of the following type values:
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_BASE
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_TERMINATION
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_FATAL
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_RECOVERABLE
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_CONFIGURATION
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_PARSER
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_CONVERSION
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_DATABASE
  • CCI_EXCEPTION_ST_TYPE_EXCEPTION_USER

The value returned in the exception_st.messageNumber field, for exceptions resulting in a BIP cataloged exception message, contains the message level in the high order bytes and the BIP message number in the lower four bytes.

Return values

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

Example

typedef struct exception_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 */
  const char*       traceText;     /* Trace text associated with exception */
  CCI_STRING_ST     objectName;    /* Object name */
  CCI_STRING_ST     objectType;    /* Object type */
} CCI_EXCEPTION_ST;
char msgnumTypeStr[64];


CCI_EXCEPTION_ST exception_st = malloc(sizeof(CCI_EXCEPTION_ST));
int rc = 0;
memset(&exception_st,0,sizeof(exception_st));
cciGetLastExceptionData(&rc, &exception_st);
sprintf(msgnumTypeStr, "MsgNum: %d Type: %d", 
(exception_st.messageNumber & 0x0ffff),
(exception_st.type & 0x0f));

as08551_.htm | Last updated Friday, 21 July 2017