Provide zero or more <catch> and one <catchall> element to catch faults and system errors.
<scope> <throw fault='"MyFault"'/> ... <faulthandlers> <catch fault='"MyFault"'> ... </catch> <catch fault='"OtherFault"'> ... </catch> <catchall> ... </catchall> </faulthandlers> </scope>
|Attribute or Element||Description|
|name, disabled, xpos, ypos, xend, yend attribute||See ““Common Attributes and Elements.””|
|<catch> element||There may be zero or more <catch> elements inside <faulthandlers>. Each catches a specific, named fault produced by a <throw> element.|
|<catchall> element||Catch a fault or system error that does not match any <catch>. If there are no <catch> elements in <faulthandlers>, there must be a <catchall>. Otherwise, <catchall> is optional.|
To enable error handling, BPL defines an element called <scope>. A scope is a wrapper for a set of activities. This scope may contain one or more activities, one or more fault handlers, and zero or more compensation handlers. The <faulthandlers> element is intended to catch any errors that activities within the <scope> produce. The <catch> and <catchall> elements within <faulthandlers> may provide <compensate> statements that invoke <compensationhandler> elements to compensate for those errors.
When a <scope> provides no <faulthandlers> block, InterSystems IRIS automatically outputs the system error to the Event Log. When a <scope> does contain a <faulthandlers> block, the BPL business process must output <trace> messages to the Event Log for system error messages to appear there. System error messages appear on the Terminal console, in either case.
For details, see “BPL Error Handling Conventions” in Developing BPL Processes.
It is not possible to reverse the order of <compensationhandlers> and <faulthandlers>. If both blocks are provided, <compensationhandlers> must appear first and <faulthandlers> second.