Error Responses

Error Response Headers

In an error response, header information contains:

  • Content-Type: application/xml
  • HTTP status code 3xx, 4xx, or 5xx. For details, see Table 1.

Error Response Body

The response body contains several elements that provide error details. The following is an example error response containing all common elements in REST error responses:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>NoSuchKey</Code>
<Message>The resource you requested does not exist</Message>
<Resource>/example-bucket/object</Resource>
<RequestId>001B21A61C6C0000013402C4616D5285</RequestId>
<HostId>RkRCRDJENDc5MzdGQkQ4OUY3MTI4NTQ3NDk2Mjg0M0FB
QUFBQUFBYmJiYmJiYmJD</HostId>
</Error>

Error Response Elements

Table 1 describes REST error response elements.

Table 1 Error response elements

Element

Description

Error

Root element that describes the error in an XML response body.

Code

HTTP return code that corresponds to the error in the XML response body. For details about error codes, see Table 1.

Message

Details the error in the XML error response body. For details about error messages, see Table 1.

RequestId

ID of the request whose error response is returned. The ID is used for locating the error.

HostId

ID of the server that returns an error response.

Resource

The requested resource such as a bucket or object.

NOTE:

Some error responses contain more detailed information. It is recommended to log all error information for easier rectification of errors.

Registration