Lança uma exceção. A exceção é lançada pela interface do intermediário de mensagens utilizando os argumentos especificados como dados da exceção.
void cciThrowExceptionW( int* returnCode, CCI_EXCEPTION_TYPE type, const char* file, int line, const char* function, const CciChar* messageSource, int messageNumber, const CciChar* traceText, ... );
void raiseExceptionWithBroker(CciChar* helpfulText, char* file, /* cujo arquivo de origem está interrompido */ int line, /* linha no arquivo acima */ char* func /* função no arquivo acima */ ){ int rc = CCI_SUCCESS; /* Configurar o nome do catálogo de mensagens */ const char* catalog = "BIPv600"; /* Converter o nome do catálogo para caracteres amplos. * BIP_DEF_COMP_CCSID é UTF-8 em distribuído e LATIN1 no z/OS */ int maxChars = strlen(catalog)+1; CciChar* wCatalog =(CciChar*)malloc(maxChars*sizeof(CciChar)); cciMbsToUcs(&rc, catalog, wCatalog, maxChars, BIP_DEF_COMP_CCSID); /* O item acima pode ter falhado, mas já está sendo emitida uma exceção, * assim, rc é agora configurado como tipo de sucesso. */ rc = CCI_SUCCESS; /* Emitir a exceção. A explicação será incluída como o traceText e * como uma inserção na mensagem */ cciThrowExceptionW(&rc, CCI_FATAL_EXCEPTION, file, line, func, wCatalog, BIP2111, helpfulText, helpfulText, (CciChar*)0 ); /* O item acima pode ter falhado, mas já está sendo emitida uma exceção, * assim, o valor de rc não é importante. */ }