VLSsetErrorHandler

Syntax

LS_STATUS_CODE VLSsetErrorHandler (	 	 
LS_STATUS_CODE	 	(*myErrorHandler) (LS_STATUS_CODE, char*),
LS_STATUS_CODE	 	LSErrorType );

Description

Enables registration of custom error handlers.

In some situations, the default responses may not be suitable. Therefore, Sentinel RMS allows custom error handling routines to replace the default routines. Customized routines should perform actions that are functionally similar to the defaults.

myErrorHandler must point to the error handling function and adhere to the prototype outlined below. LSErrorType must indicate the type of the error to be handled. The Sentinel RMS Development Kit default routines continue to handle other errors. The customized function should accept as input the error code of the condition that caused it to be called and the name of the feature. The same error-handling function can be used to handle all error conditions for all features of an application, using internal conditional statements. The special target error code, VLS_EH_SET_ALL, can be used to set up the provided error handler to handle all errors.

Customized error handlers must adhere to the following prototype:

LS_STATUS_CODE	 myErrorHandler,
LS_STATUS_CODE	  errorCode,
char	 	 *featureName;
Argument Description

errorCode

The error code to be handled.

featureName

The name of the feature involved in the error.

Returns

The status code LS_SUCCESS is returned if successful. Otherwise, it will return the following error codes:

Error Code

Description

VLS_CALLING_ERROR

>myErrorHandler parameter is NULL

>LSErrorType is an invalid error type.

For a complete list of the error codes, see Licensing Library Error and Result Codes.