Hello All,
I am sending a request to salesforce and in return, I am getting HTTP error code 400 I.e Bad request.
How can I catch this fault using fault rule and the best way to tackle this.
Thank you in advance.
Answer by Divakar Sharma · Sep 05, 2018 at 08:57 AM
Hello Umanng
Can you please let us know how the <Condition></Condition> will look like?
I used the second approach i.e Set fault rules in or target end point and provide a generic error message for the same using assign message policy
Below is the faultRue logic worked for me.
<FaultRules>
<FaultRule name="Invalid_Response">
<Step> <Name>Extract-Variables.InsertOrUpdateTicketResp</Name></Step>
<Step> <Name>InsertOrUpdateTicket.ResponseForBadReq</Name> </Step>
<Condition>(error.status.code == "400")</Condition>
</FaultRule>
</FaultRules>
Thank you all.
.
Answer by Umanng · Sep 05, 2018 at 08:05 AM
There are multiple ways to do that.
1: Use raise fault policy and set the condition based on the sales force error.
2: Set some fault rules in default proxy or target end point and provide a generic error message for the same using assign message policy.
Service Callout timeout FaultRule not honored 1 Answer
VerifyJWT Policy fault variable not available 1 Answer
Logging context information in error flow 2 Answers
how to access response code variable in case of failure? 1 Answer
Is there a system variable that indicates any of the FaultRule conditions succeeded? 1 Answer