Getting HTTP error code 400

Not applicable

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.

Solved Solved
0 3 822
1 ACCEPTED SOLUTION

divakars
Participant I

Hello Umanng

Can you please let us know how the <Condition></Condition> will look like?

View solution in original post

3 REPLIES 3

umannggoel
Participant II

@Anil Agrawal

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.

divakars
Participant I

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.

.