A system, method and article of manufacture are provided for minimizing the amount of changes that need to be made to exception handling logic when new exceptions are added. Exceptions are organized into hierarchies in a polymorphic exception handler. A root of one of the hierarchies in which an exception occurs is caught. The exception is instructed to rethrow itself. The rethrown exception is caught and identified. A type of the rethrown exception is determined and a message is outputted indicating the type of the rethrown exception.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method for minimizing the amount of changes that need to be made to exception handling logic when new exceptions are added, comprising the steps of: (a) organizing exceptions into hierarchies in a polymorphic exception handler; (b) catching a root of one of the hierarchies in which an exception occurs; (c) instructing the exception to rethrow itself; (d) catching the rethrown exception; (e) identifying the rethrown exception; (f) determining a type of the rethrown exception; (g) outputting a message indicating the type of the rethrown exception; and (h) creating catch blocks to catch the rethrown exception.
2. A method as recited in claim 1 , wherein single exception interfaces are used as the roots of the hierarchies.
3. A method as recited in claim 1 , wherein the polymorphic exception handler handles each unique root.
4. A method as recited in claim 1 , wherein an added exception is organized into a hierarchy and handled by the polymorphic exception handler.
5. A method as recited in claim 1 , wherein handling behavior is encapsulated in the polymorphic exception handler.
6. A computer program embodied on a computer readable medium for minimizing the amount of changes that need to be made to exception handling logic when new exceptions are added, comprising: (a) a code segment that organizes exceptions into hierarchies in a polymorphic exception handler; (b) a code segment that catches a root of one of the hierarchies in which an exception occurs; (c) a code segment that instructs the exception to rethrow itself; (d) a code segment that catches the rethrown exception; (e) a code segment that identifies the rethrown exception; (f) a code segment that determines a type of the rethrown exception; (g) a code segment that outputs a message indicating the type of the rethrown exception; and (h) a code segment that creates catch blocks to catch the rethrown exception.
7. A computer program as recited in claim 6 , wherein single exception interfaces are used as the roots of the hierarchies.
8. A computer program as recited in claim 6 , wherein the polymorphic exception handler handles each unique root.
9. A computer program as recited in claim 6 , wherein an added exception is organized into a hierarchy and handled by the polymorphic exception handler.
10. A computer program as recited in claim 6 , wherein handling behavior is encapsulated in the polymorphic exception handler.
11. A system for minimizing the amount of changes that need to be made to exception handling logic when new exceptions are added, comprising: (a) logic that organizes exceptions into hierarchies in a polymorphic exception handler; (b) logic that catches a root of one of the hierarchies in which an exception occurs; (c) logic that instructs the exception to rethrow itself; (d) logic that catches the rethrown exception; (e) logic that identifies the rethrown exception; (f) logic that determines a type of the rethrown exception; (g) logic that outputs a message indicating the type of the rethrown exception; and (h) logic that creates catch blocks to catch the rethrown exception.
12. A system as recited in claim 11 , wherein single exception interfaces are used as the roots of the hierarchies.
13. A system as recited in claim 11 , wherein the polymorphic exception handler handles each unique root.
14. A system as recited in claim 11 , wherein an added exception is organized into a hierarchy and handled by the polymorphic exception handler.
15. A system as recited in claim 11 , wherein handling behavior is encapsulated in the polymorphic exception handler.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
August 31, 1999
December 31, 2002
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.