13.6 Batch Error Handling
The SData provider MUST return one of the following HTTP status codes when responding to a batch request:
Code | Description |
---|---|
200 OK | Batch was processed (synchronously or asynchronously). This status doesn't mean that the individual batch entries have been successful, just that the batch, as a whole, has been processed. The status on individual batch entries MUST be returned via <http:httpStatus> elements in the returned entries. |
202 Accepted | An asynchronous batch operation was accepted. Or is in progress if this is a tracking request. A Location header with the tracking URL MUST be returned. The payload MUST be an <sdata:tracking> payload. See Tracking Payload section. |
400 Bad Request | Generic status for consumer side error. The batch request, as a whole, is invalid. The consumer MUST modify it before resubmitting. |
401 Unauthorized | Request requires user authentication. See Authentication section for details. |
403 Forbidden | Consumer is not authorized to start the batch operation. |
404 Not Found | One of the elements specified in the URLdoes not exist. For example, application name, contract name, or operation name. |
410 Gone | The resource has already been deleted. This MAY be returned when deleting an asynchronous batch tracking resource. |
500 Internal Server Error | Serious provider error. Client SHOULD NOT retry the request. |
503 Service Unavailable | Transient provider error. Client MAY retry the request. The provider SHOULD include a Retry-After header in its response to indicate when the consumer MAY retry the request. |
When the service returns a 4xx or a 5xx status code, it MUST include an <sdata:diagnoses> payload with details about the error in its response. Except in the 410 case, which is a success code. See Error Payload section for details.
SData providers MUST return errors as described above