<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
        SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
       title="Error Handling" id="Error-Handling">

    <p>This section describes error responses defined in <code>openapi.yaml</code>.</p>

    <chapter title="Error Schema" id="error-format">
        <p>The shared <code>Error</code> schema is:</p>
        <code-block lang="json">
{
  "error": "Invalid API token",
  "code": 401
}
        </code-block>
    </chapter>

    <chapter title="HTTP Status Codes" id="status-codes">
        <p>Common error status codes used across endpoints:</p>
        <table>
            <tr>
                <td>Code</td>
                <td>Meaning</td>
            </tr>
            <tr>
                <td>400</td>
                <td>Bad Request</td>
            </tr>
            <tr>
                <td>401</td>
                <td>Unauthorized</td>
            </tr>
            <tr>
                <td>403</td>
                <td>Forbidden</td>
            </tr>
            <tr>
                <td>404</td>
                <td>Not Found</td>
            </tr>
            <tr>
                <td>409</td>
                <td>Conflict</td>
            </tr>
            <tr>
                <td>422</td>
                <td>Unprocessable Entity</td>
            </tr>
            <tr>
                <td>500</td>
                <td>Internal Server Error</td>
            </tr>
        </table>
    </chapter>
</topic>
