Error handling for ABL-extended .NET classes
- Last Updated: March 25, 2025
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
As noted previously, an ABL method that overrides a .NET method,
or that implements a method defined in a .NET interface, can
be called from the .NET context. Similarly, an ABL property
that implements a property defined in a .NET interface can
be accessed from the .NET context. When you raise ERROR from
within such an ABL method or property accessor that is invoked from
the .NET context, and the specified ABL error options raise
the error condition out of the method or accessor block, ABL returns
a .NET System.ApplicationException to the
caller.
If you raise the error condition by executing a RETURN ERROR with
the optional error string, the Message property
of the System.ApplicationException is available
to the ABL context using the RETURN-VALUE function.
If you raise the error condition by executing a RETURN ERROR with
an optional ABL error object, or by executing an UNDO, THROW of
the ABL error object, the Message property of the System.ApplicationException includes
any messages from the ABL error object.
Note that ABL responds to errors raised from ABL handlers that you subscribe to ABL-inherited .NET events in exactly the same way as errors raised from ABL handlers of .NET instance or static events published by pure .NET classes. For more information, see Handle .NET exceptions raised during display of a .NET form.