forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
71 lines
5.7 KiB
HTML
71 lines
5.7 KiB
HTML
<a name="EN-US_TOPIC_0125560307"></a><a name="EN-US_TOPIC_0125560307"></a>
|
|
|
|
<h1 class="topictitle1">Error Responses Syntax</h1>
|
|
<div id="body29682946"><div class="section" id="EN-US_TOPIC_0125560307__section43457779"><h4 class="sectiontitle">Error Response Headers</h4><p id="EN-US_TOPIC_0125560307__p55508446">In an error response, header information contains:</p>
|
|
<ul id="EN-US_TOPIC_0125560307__ul29813974"><li id="EN-US_TOPIC_0125560307__li66999175">Content-Type: application/xml</li><li id="EN-US_TOPIC_0125560307__li66121668">HTTP status code 3<em id="EN-US_TOPIC_0125560307__i58224100">xx</em>, 4<em id="EN-US_TOPIC_0125560307__i54254858">xx</em>, or 5<em id="EN-US_TOPIC_0125560307__i18531678">xx</em>. For details, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560307__section55575695"><h4 class="sectiontitle">Error Response Body</h4><p id="EN-US_TOPIC_0125560307__p20711872">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:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0125560307__screen2218761312193"><?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> </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560307__section30419215"><h4 class="sectiontitle">Error Response Elements</h4><p id="EN-US_TOPIC_0125560307__p24863727"><a href="#EN-US_TOPIC_0125560307__table5435182">Table 1</a> describes REST response elements.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560307__table5435182"></a><a name="table5435182"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560307__table5435182" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Error response elements</caption><thead align="left"><tr id="EN-US_TOPIC_0125560307__row3125665"><th align="left" class="cellrowborder" valign="top" width="24.25%" id="mcps1.3.3.3.2.3.1.1"><p id="EN-US_TOPIC_0125560307__p51852321">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="75.75%" id="mcps1.3.3.3.2.3.1.2"><p id="EN-US_TOPIC_0125560307__p39288453">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560307__row28248118"><td class="cellrowborder" valign="top" width="24.25%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560307__p6396187">Error</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.75%" headers="mcps1.3.3.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560307__p48329116">Container of all error elements.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560307__row32308867"><td class="cellrowborder" valign="top" width="24.25%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560307__p66881467">Code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.75%" headers="mcps1.3.3.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560307__p48689731">A string that uniquely identifies an error. For details about error codes, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560307__row51554115"><td class="cellrowborder" valign="top" width="24.25%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560307__p15133796">Message</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.75%" headers="mcps1.3.3.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560307__p17877965">Error details in the XML format. For details about error codes, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560307__row38829095"><td class="cellrowborder" valign="top" width="24.25%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560307__p58149018">RequestId</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.75%" headers="mcps1.3.3.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560307__p12449997">ID of the request whose error response is returned. The ID is used for locating internal errors.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560307__row44941110"><td class="cellrowborder" valign="top" width="24.25%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560307__p16351276">HostId</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.75%" headers="mcps1.3.3.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560307__p49385016">ID of the server that returns an error response.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560307__row41811960"><td class="cellrowborder" valign="top" width="24.25%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560307__p31325629">Resource</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.75%" headers="mcps1.3.3.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560307__p54348043">The requested resource such as a bucket or object.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0125560307__p19370340"></p>
|
|
<div class="note" id="EN-US_TOPIC_0125560307__note40115337"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0125560307__p25493713">Many error responses contain additional structured data, which can be easily read and understood during error diagnosis.</p>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0125560307__p28116831"></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560387.html">Error Responses</a></div>
|
|
</div>
|
|
</div>
|
|
|