release()  setErrTxt()

Chapter 4: Production Objects and Methods

setErrNum()

Description

Sets a user-defined, alternate error number in the production object.

Syntax

setErrNum(int num);

Parameter

Description

num

Integer that serves as the alternate error number.

Return value

Integer.

Returns the value in the parameter num.

Examples

Example 36

int myerr;
my_prod.setErrNum(myerr); 
my_other_prod.setErrNum(555);

where my_prod is a production object.

Usage

This method sets a user-defined alternate error number. You may use it in a production object’s custom filter, error, generic, and qualification functions. This allows you to use a unique error number for each function so that you can immediately determine within which function the processing error occurred. This method does not replace the error number generated by the production object.

When a processing failure occurs, the alternate error number displayed is that of the last function that called setErrNum(). For example, a custom filter function calls setErrNum() to set the error code upon failure, then the error function of the production object is called, which also uses this method. The alternate error code contains the value used by the error function, not the custom filter. Also, when you use this method in a function, it sets the alternate error number regardless of whether or not the function encounters a processing error. Therefore, if the failed function does not call setErrNum(), but a previously executed function did, the alternate error number generated by the production object does not reflect the function where the processing failure actually occurred.





Copyright © 2005. Sybase Inc. All rights reserved. setErrTxt()

View this book as PDF