<FaultRules>
functionality was deprecated within Policies some time ago.
If you want to raise a custom fault for SpikeArrest, first, ensure continueOnError="true"
attribute is set in your SpikeArrest Policy. That allows you to ignore the system's generic response output. Second, you can check for the following condition in a subsequent policy, leveraging ratelimit.<spike_arrest_policy_name>.exceed.count
variable:
...
<!-- Spike Arrest policy -->
<Step>
<Name>SpikeArrest.BurstProtection</Name>
</Step>
<!-- RaiseFault for Spike Arrest violation -->
<Step>
<Condition>(ratelimit.SpikeArrest.BurstProtection.exceed.count > 0)</Condition>
<Name>RaiseCustomFault</Name>
</Step>
...
Once the condition is met, you raise your own custom fault msg.
It's also worth noting that SpikeArrest doesn't really have a count, per say. See here on another SO question on SpikeArrest.
IMPORTANT EDIT
ratelimit.<spike_arrest_policy_name>.exceed.count>0
check does not work at this time. A good alternative, as suggested by Michael, is to leave continueOnError="true"
(the default). Let the Spike Arrest fault, and then at the top of Proxy file, leverage the FaultRules section. You can check for the proper FaultRule condition as follows:
<FaultRules>
<FaultRule name="FaultHandling">
<Step>
<Condition>(fault.name = "SpikeArrestViolation")</Condition>
<Name>RaiseSpikeCustomFault</Name>
</Step>
</FaultRule>
</FaultRules>
The fault.name
values are listed on the public docs site under each topic, so SpikeArrest's are here. See under "Policy-specific error codes."