Errors
Possible types of errors
Errors code are standard errors codes which can be found in RFC 7231
Client Error 4xx
The 4xx (Client Error) class of status code indicates that the client seems to have erred.
Server Error 5xx
The 5xx (Server Error) class of status code indicates that the server is aware that it has erred or is incapable of performing the requested method.
Error code names
Error codes consist on json objects with
- An
objectOrError
argument defines the JSON response body or the message string. - The
description
argument contains a short description of the HTTP error.
By default, the JSON response body contains two properties:
statusCode
: this will be a HTTP status code .message
: A string for example'Bad Request'
Table with all errors
Error name | Status code | Description |
---|---|---|
Bad Request | 400 | The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). |
Unauthorized | 401 | unauthorized requests |
Not Found | 404 | The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists. |
Forbidden | 403 | The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it. A server that wishes to make public why the request has been forbidden can describe that reason in the response payload (if any). |
Method Not Allowed | 405 | The 405 (Method Not Allowed) status code indicates that the method received in the request-line is known by the origin server but not supported by the target resource. |
Not Acceptable | 406 | This return code is normally interpreted as "The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request |
Request Timeout | 408 | The 408 (Request Timeout) status code indicates that the server did not receive a complete request message within the time that it was prepared to wait. |
Conflict | 409 | The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource. |
Gone | 410 | The 410 (Gone) status code indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent. |
Precondition Failed | 412 | |
Payload Too Large | 413 | The 413 (Payload Too Large) status code indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process. |
Unsupported Media Type | 415 | |
Im A Teapot | 418 | Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout. |
Unprocessable Entity | 422 | |
Internal Server Error | 500 | The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. |
Not Implemented | 501 | The 501 (Not Implemented) status code indicates that the server does not support the functionality required to fulfill the request. |
Bad Gateway | 502 | The 502 (Bad Gateway) status code indicates that the server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request. |
Service Unavailable | 503 | The 503 (Service Unavailable) status code indicates that the server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. |
Gateway Timeout | 504 | The 504 (Gateway Timeout) status code indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. |
Http Version Not Supported | 505 | The 505 (HTTP Version Not Supported) status code indicates that the server does not support, or refuses to support, the major version of HTTP that was used in the request message. |