Die Ausnahmebedingung cciThrowExceptionW wird durch die Brokerschnittstelle ausgelöst, die angegebenen Argumente bilden dabei die Ausnahmedaten.
void cciThrowExceptionW( int* returnCode, CCI_EXCEPTION_TYPE type, const char* file, int line, const char* function, const CciChar* messageSource, int messageNumber, const CciChar* traceText, ... );
Das letzte Argument in dieser Liste muss (Ccichar*)0 sein.
void raiseExceptionWithBroker(CciChar* helpfulText,
char* file, /* which source file is broken */
int line, /* line in above file */
char* func /* function in above file */
){
int rc = CCI_SUCCESS;
/* Set up the message catalog name */
const char* catalog = "BIPv600";
/* Convert the catalog name to wide characters. * BIP_DEF_COMP_CCSID is UTF-8 on distributed and LATIN1 on z/OS
*/
int maxChars = strlen(catalog)+1;
CciChar* wCatalog =(CciChar*)malloc(maxChars*sizeof(CciChar));
cciMbsToUcs(&rc, catalog, wCatalog, maxChars, BIP_DEF_COMP_CCSID);
/* The above might have failed, but we are already throwing an exception,
* so rc is now set to type success. */
rc = CCI_SUCCESS;
/* Throw the exception. The explanation will be added as the traceText and
* as an insert to the message
*/
cciThrowExceptionW(&rc,
CCI_FATAL_EXCEPTION,
file, line, func,
wCatalog, BIP2111,
helpfulText,
helpfulText,
(CciChar*)0
);
/* The above might have failed, but we are already throwing an exception,
* so the value of rc is not important. */
}