Fault handling shared flow

Not applicable

As per the docs,

A <DefaultFaultRule> section, which triggers a default error message if no <FaultRules> are defined or no existing <FaultRules> get executed.

It works as mentioned if I use policies in the Faultrules but doesn't work if I have a shared flow (with few conditional policies) in the fault rule.

Is there any other way to get the default fault rule(defined in the APIproxy) to execute when no policies in the fault handling shared flow execute?

0 7 660
7 REPLIES 7

You could always turn on: <AlwaysEnforce>true</AlwaysEnforce>

    <DefaultFaultRule name="DefaultFaultRule">
        <Step>
            <Name>FC-ProxyDefaultFaultRule</Name>
        </Step>
        <AlwaysEnforce>true</AlwaysEnforce>
    </DefaultFaultRule>
    <FaultRules>
        <FaultRule name="ProxyFaultRules">
            <Step>
                <Name>FC-ProxyFaultRules</Name>
            </Step>
        </FaultRule>
    </FaultRules>

True but want to use that as the final fault rule which gets executed when none of the faultrules execute.
Looks like we can't use Shared flows + DefaultFaultRule with <AlwaysEnforce>false</AlwaysEnforce>

Do you have conditions on all of your FaultRules?

Just one faultrule which has a SF which has around 5 steps.

Ah, so if there is no condition on that Step then as far as FaultRules are concerned, a FaultRule executed.

Hi Maruti, not sure if I totally understand your question, but I put together a working example of how to use a shared flow for error handling. It is available here: https://github.com/davidmehi/edge-shared-errorhandling-flow-example

@David Mehi

You have the below in your example:

<FaultRules>

<FaultRule name="Shared Fault Rules">

<Step>

<Name>FlowCalloutFaultRulesHandling</Name>

</Step>

</FaultRule>

<!-- could put additional fault rules here if needed -->

</FaultRules>

<DefaultFaultRule name="all">

<AlwaysEnforce>true</AlwaysEnforce>

<Step>

<Name>FlowCalloutFaultRulesHandling</Name>

</Step>

</DefaultFaultRule>


but looks like the DefaultFaultRule with AlwaysEnforce = not true(default) doesn't work as expected.