Try OpenEdge Now
skip to main content
Object-oriented Programming
Programming with Class-based Objects : Raising and handling error conditions : Raising errors within a method
 

Raising errors within a method

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.
* Method error handling example