Is it possible to handle exceptions raised in the post proxy flow hook??

Not applicable

Hello everyone,

I am using flow hooks to implement a certain business use case. As such everything works as expected. Even though any of my flow hooks fail (except post proxy flow hook ) it still goes into the error flow and the corresponding error is logged. But when the post proxy flow hook fails, i don't see this happening. The post proxy flow hook is executed after the error flows and before the response is sent to the client.

My concern is if my post proxy flow hook fails , i am unable to handle the error response.

Are there any work arounds for this?

Any pointers are highly appreciated. Thanks

0 2 546
2 REPLIES 2

Not applicable

Hi @Raghavendra ,

Have the continueOnError="true" in the policy that you have in the shared flow which you attached to the post proxy hook so that you can use whether the policy failed or not in the condition on your raise fault policy/any policy to respond custom response as shown below

([prefix].[policy_name].failed = true/false)

Example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SharedFlow name="default">
    <Step>
        <Name>Basic-Authentication-1</Name>
    </Step>
    <Step>
        <Condition>BasicAuthentication.Basic-Authentication-1.failed == true</Condition>
        <Name>Raise-Fault-1</Name>
    </Step>
</SharedFlow>

Not applicable

Yes, this doesn't go to fault rules after post proxy flow hook. I would suggest to use continue on error true and raise fault with condition for that policy fail and customise the error. That we are using in our case.