cancel
Showing results for 
Search instead for 
Did you mean: 

$batch response error handling

abhiperiwal
Participant
0 Kudos

Hi,

I'm receiving number of PUTs in $batch POST request and after processing in case of any error, the error text is sent in the response body. The header HTTP status remains 202 (Accepted) irrespective of success or failure in batch response.

What is the best way to handle this response in UI to read the error messages?

OR

Is there a way to modify the HTTP status code to indicate error in the response body?

Thanks for your help.

Regards,

Abhishek

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Abhishek,

202 is the expected status and indicates that Request is accepted for processing.

In your case for every request ( PUT operation ) inside the payload, you would get 204 No Content on successful Update of each entry.

The response will have the status for each operation.

We need to read the Status of each operation inside response body and act accordingly.

We should not modify any Status which is set by our Gateway.

Regards,

Ashwin

abhiperiwal
Participant
0 Kudos

Thanks Ashwin.

Based on your response I come to the second question.

How would UI read the status and error messages from the response body.

Is there way to share code snippet for that?

It will very helpful.

Regards,

Abhishek

Answers (0)