ERROR-STATUS system handle
A handle to error information on the last statement executed with the NO-ERROR option.
Syntax
attribute
method
Attributes
Methods
ExamplesThe following example uses the NO-ERROR and the ERROR-STATUS handle extensively to demonstrate when ERROR-STATUS attributes are reset:
Within the internal procedure, chk-connect, the first reference to ERROR-STATUS:ERROR returns status on the CONNECT statement from the main procedure. The second reference returns status on the assignment statement. The reference to ERROR-STATUS:ERROR in the main procedure returns status on the RUN statement. Note that the ERROR-STATUS attributes are set only after the statement with NO-ERROR completes. Therefore the references in the internal procedure are not affected by the RUN statement itself.
The following procedure accepts a character string value and lets you convert it to one of several data types. The internal convert procedure attempts the conversion. If the conversion is successful, it displays the converted value. If the conversion is unsuccessful, the ERROR-STATUS handle holds error information. After running convert, the CHOOSE trigger checks ERROR-STATUS:ERROR and ERROR-STATUS:NUM-MESSAGES to determine if either error information is available or messages have been returned, even if ERROR is not raised. If either condition is true, this lets you view this information. ABL includes many errors that generate messages, but do not raise the ERROR condition, such as most errors generated by ABL built-in functions and handle methods.
Notes
- The ERROR attribute indicates whether the ERROR condition was raised during the execution of the last statement that contained the NO-ERROR option. Some errors may occur without raising the ERROR condition. For example, compiler errors do not raise the ERROR condition.
- The NUM-MESSAGES attribute indicates the total number of errors that occurred during that statement.
- The ERROR-OBJECT-DETAIL attribute identifies a SOAP-fault object that contains SOAP fault message detail.
If a Web service operation generates a SOAP fault message, the AVM generates the following error:
The complete SOAP fault error message is returned to the AVM as part of the ERROR-STATUS system handle.If the ABL application invokes the Web service operation with the NO-ERROR option on the RUN statement, any errors that occur as a result of the operation are suppressed. In this case, the application can access the SOAP fault message detail using the SOAP-fault and SOAP-fault-detail object handles. Otherwise, the AVM displays the error message to the end user.- The TYPE attribute returns the widget type, PSEUDO-WIDGET.
- The GET-MESSAGE method and the GET-NUMBER method let you access the error numbers and messages for all errors that occurred during the execution of the last statement with the NO-ERROR option.
- Usually, the NO-ERROR option on a statement suppresses the display of error messages. However, if a STOP condition occurs, the error message is written to the windows. These messages are also available through the ERROR-STATUS attributes. For example, the STOP condition is raised when a procedure to be run is not found. Two specific instances of this are:
See also
OpenEdge Release 10.2B
|