Skip to main content

<faulthandlers>

Provide zero or more <catch> and one <catchall> element to catch faults and system errors.

Syntax

<scope>
   <throw fault='"MyFault"'/>
         ... 
     <faulthandlers>  
        <catch fault='"MyFault"'>
           ...
        </catch>
        <catch fault='"OtherFault"'>
           ...
        </catch>
        <catchall>
           ...
        </catchall>
   </faulthandlers> 
</scope>

Attributes and Elements

name, disabled, xpos, ypos, xend, yend attributes
<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.

Description

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 in the ObjectScript shell, in either case.

For details, see Handling Errors in BPL.

Note:

It is not possible to reverse the order of <compensationhandlers> and <faulthandlers>. If both blocks are provided, <compensationhandlers> must appear first and <faulthandlers> second.

See Also

FeedbackOpens in a new tab