vxi-discuss



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in VXIapiRun - does not handle error code




When VXI::run() returns VXIresultError, for example when it can't
load a document, VxiApiRun() does NOT handle it correctly -- it returns
VXIresultSuccess instead.  You can correct it (in Vxi_api.c) as
shown below:

/*
 *  -- call the DOM parser on the file
 */
extern "C"
VXI_API VXIresult
VXIapiRun(void* vxi,VXIchar* url){
	VXI* pp = (VXI*)vxi;
	int rtnCode;
	/* Must check here as NULL url has meaning to VXI::run() */
	if(url == NULL)
		return(VXIresultERROR);
	try{
		rtnCode = pp->run(url);
	}
	catch(...){
		rtnCode = RTN_ERROR;
	}
	// FIX: add check for VXIResultError
	if(rtnCode == RTN_ERROR || rtnCode == VXIresultError)  
		return(VXIresultERROR);
	if(rtnCode == RTN_JSERROR){
		printf("Fatal JavaScript error!!!!\n");
		return(VXIresultJSERROR);
	}
	return(VXIresultSUCCESS);
}


Bill Walker
Avaya Inc.
wjw@avaya.com
1-732-817-4609





This page is maintained by Alan W Black (awb@cs.cmu.edu)
speechinfo.org is hosted on a machine donated by VA Linux Systems
VA Linux Systems