wcTraceWarn( )

Syntax . . Returns . . Program Example . . Related Topics . . A-Z Index . . Home

Places an error message in the log file and returns control to the last previous API call in your application. wcTraceErr( ) raises an exception and WcTraceWarn() does not raise an exception; otherwise these two functions are identical.

Example

returnCode = wcTraceWarn(cntrlHandle, retCode);

Syntax

int wcTraceWarn(void *controlHandle, 
                int errorCode)
controlHandleThe handle to the control structure.
errorCodeThe code number of the error you want to log. You can define your own error code or use one of the predefined codes described in Error Messages.

Returns

0Success.
Error codeFailure or exception. For a list of possible error codes, see Error Messages.

Program Example

The following code shows how wcTraceWarn( ) is used in an application.

int requestLoop(wcp)
	void	*wcp;
{
	int	ret;

	/* set defaults */
	wcSetVariable(wcp, "MItab", "webPages");
	wcSetVariable(wcp, "MIcol", "object");
	wcSetVariable(wcp, "MInam", "ID");
	wcSetVariable(wcp, "MIval", "main");

	while(1)
	{
		if((ret = wcConOpen(wcp, 0)) < 0)
			return wcTraceWarn(wcp, ret);

		handleRequest(wcp);

		if((ret = wcConClose(wcp)) < 0)
			return wcTraceWarn(wcp, ret);
	}
}

In this code fragment, it is assumed that the function handleRequest( ) has been declared to return an HTML page to the browser.

Related Topics

wcLogPrintf( )
wcMessagePage( )
wcTraceErr( )


Top of Page . . Syntax . . Returns . . Program Example . . A-Z Index . . Home