title: Best practices to define custom error codes for an API
body: <p>We are planning to develop an API. There are so many cases that a request can be considered as a bad request.
  For this, We have planned to send a JSON object with <code>error code</code>, <code>error</code>,
  and <code>additional info</code></p>
  <p>I have put the sample case here when a user sends an illumination image. We considered as this request is bad request and send the following JSON</p>
  <pre class="lang-json prettyprint-override"><code>{
  &quot;ErrorCode&quot;: 10000,
  &quot;Error&quot;: &quot;Detected uneven illumination image&quot;,
  &quot;Additional Info&quot;: &quot;Prefer to change the image location&quot;
  }
  
  </code></pre>
  <ol>
  <li>Is  our JSON object format is good or we need to add the HTTP Error code like 400/404</li>
  <li>How to select this custom error code? We are planning to take the error code number from 10000.</li>
  </ol>
  <p>Can someone please help us or <strong>provide some trustful resources</strong>?</p>