Raise errors within a method
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
When a method raises an error from a RETURN ERROR,
an UNDO, THROW, or an unhandled system
error the effects depend on the context of the method call. In general,
the results of raising ERROR from within a non-VOID or
a VOID method (or non-VOID method
executed as a statement, ignoring the return value) are similar,
and correspond to the results of raising ERROR from
within an expression or a procedure, respectively.
So, if a non-VOID method raises ERROR in
an expression, the ERROR is raised on the statement
containing the expression, and the existing value of any receiving
data element for the expression remains unchanged. In expressions that
contain multiple method calls, methods execute in order from left
to right. In the case of an error condition, all methods in the
expression execute, in order, prior to the one that raises ERROR,
and the existing value for any receiving data element for the expression,
again, remains unchanged.