Handle .NET exceptions
- Last Updated: March 25, 2025
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
.NET error handling is based on a structured error
handling model that encapsulates each error by an object type referred
to as an exception. The base class for all .NET exceptions
is System.Exception, and ABL allows
you to trap System.Exception and all of its derived .NET Exception objects
in much the same way as you trap ABL error objects.
In order to trap and handle .NET Exception objects in
common with ABL error objects, OpenEdge has enhanced the .NET System.Exception class
to implement the Progress.Lang.Error interface.
Implementing this interface allows you to handle all .NET exceptions
that are raised in the ABL context by both traditional and structured
ABL error handling constructs.
If you use traditional error handling, you can trap a .NET exception raised from accessing .NET objects in a given block, and raise that exception to the next enclosing block, as with any ABL error.
If you use structured error handling, you can catch and throw
a .NET Exception object and consult the same
properties and methods as for a Progress.Lang.ProError object.
However, these extended OpenEdge properties and methods function
a little differently for a .NET exception than for an ABL
error.
For more information on:
- The properties and methods available on .NET
Exceptionobjects, see Use properties and methods on .NET exception objects. - Differences in handling .NET exceptions compared to ABL errors, see Unique scenarios when handling errors with .NET objects.