TestCompError

Description

Tests whether an EAServer component method that was just called had an error. This method is for use with JSP 4GL targets only.

Applies to

psPage object

Syntax

psPage.TestCompError ( string location )

Argument

Description

location

The objectName.methodName on which the error is detected

Returns

Boolean. The method returns true if an error occurred on an EAServer component method call. In that case, the ReportError method passes the location and the system message generated by the call. If no error occurred, the method returns false.

Usage

All EAServer component method calls done by the Web Target object model invoke this method. Add TestCompError calls after your own calls to components to check that they do not produce any errors.

You must make sure to generate stubs for all your EAServer components and compile them.

Examples

Example 1

This call to the EAServer component method nvo_math.division returns a divide-by-zero error from the server when its second argument is set to zero. Calling TestCompError will cause the error to display on your Web page:

nvo_math.division(m1, m2);
psPage.TestCompError("call to nvo_math.division");

The following result displays on the Web page when the divisor is set to zero:

call to nvo_math.division:Component Call Failed:Exception thrown: CTS.PBUserException: Divide by zero;1;3;nvo_math;nvo_math;division; in method division of class new_math/_st_nvo_math. 

See also

ReportError