Skip to main content

Exception and Condition Handling Classes

Printer-friendly version

One of the problems faced by ABL programmers for many years is the lack of a true exception handling mechanism in the language. By “exception handling”, we mean a mechanism by which a program encounters an error or unexpected condition then can communicate up the call stack with the purpose of:
1. Signaling that requested execution has not completed as expected;
2. Communicating any necessary information about the details of why this condition occurred; and
3. Providing a structure such that the condition is “handled” in a graceful fashion at an appropriate level in the code.

While exception handling support in many languages is heavily focused on “Exceptions ”, i.e., circumstances which prevent continued execution in the normal flow of control, some languages generalize this mechanism to what some call condition handling . The generalization to “conditions” broadens the potential communication to conditions of possible interest beyond those that one would normally consider errors or exceptions. Moreover, many conditions depend on context as to whether or not they should be considered an exception.

Download document to continue reading ...

Downloads include documentation, the exception handling classes, and test code to validate function.

Note that this code does not take advantage of the recent block error handling constructs added to ABL and so is usable in earlier versions. Since the functionality of this code is a superset of the language features, it is not obsoleted by those new features, although I do plan on a new version which combines the two into an overall solution with guidance on how they should be used together.

ExceptionStack.pdf94.41 KB
ExceptionStackCode.zip6.38 KB
ExceptionStackTest.zip1.75 KB