Sun N1 Service Provisioning System 5.1 XML Schema Reference Guide

<raise> Step

The <raise> step is a step that always fails, though it can be caught and handled by a <try> step. See <try> Step.

The <raise> step is used to indicate a failure condition without having to construct an artificial step to do so. This step most often appears within a <catch> block to propagate an error condition after cleaning up. See <catch> Element.

Attributes for the <raise> Step

The <raise> element has one optional attribute, message, which is a message that describes the error condition. By default, the message is a generic system-specified message. This attribute can reference simple substitution variables.


Example 2–2 Using the <raise> Step

The following example shows how the <raise> step is used to repropagate an error condition from within a <catch> block, after noting the error in a log.


<control blockName="default">
    <try>
        <block>
            <!-- some arbitrary processing here -->
        </block>
        <catch>
            <!-- note error in log -->
            <execNative>
                <exec cmd="appendLog">
                    <arg value="an error occurred"/>
                </exec>
            </execNative>
            <!-- rethrow error -->
            <raise/>
        </catch>
    </try>
</control>