cciGetLastExceptionDataW

获取有关生成的最后一个异常的诊断信息。有关当前线程上生成的最后一个异常的信息在 CCI_EXCEPTION_WIDE_ST 输出结构中返回。用户定义的扩展可以使用此函数来确定当实用程序函数返回错误代码时是否需要任何恢复。

当通过将 returnCode 设置为 CCI_EXCEPTION,向实用程序函数表明发生了异常时,可能调用此函数。

语法

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

参数

returnCode
接收来自函数(输出)的返回码。可能的返回码是:
  • 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
指定用于接收有关最近一个异常(输出)的数据的 CCI_EXCEPTION_WIDE_ST 结构地址。

返回值

无。 如果发生错误,则 returnCode 参数表明错误原因。

示例

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);
声明 | 商标 | 下载 | | 支持 | 反馈
Copyright IBM Corporation 1999, 2006 最后更新:2006/05/19
as24620_