Error Response
All the possible error responses that are returned from Eludris HTTP microservices.
Rate Limited
The error when a client is rate limited.
Field | Type | Description |
---|---|---|
type | “RATE_LIMITED” | The type of this ErrorResponse variant. |
status | u16 | The HTTP status of the error. |
message | String | A brief explanation of the error. |
try_after | Number | The amount of milliseconds you’re still rate limited for. |
Example
{
"type": "RATE_LIMITED",
"status": 429,
"message": "You have been rate limited",
"try_after": 1234
}
Validation
The error when a request a client sends is incorrect and fails validation.
Field | Type | Description |
---|---|---|
type | “VALIDATION” | The type of this ErrorResponse variant. |
status | u16 | The HTTP status of the error. |
message | String | A brief explanation of the error. |
value_name | String | The name of the value that failed validation. |
info | String | Extra information about what went wrong. |
Example
{
"type": "VALIDATION",
"status": 422,
"message": "Invalid request",
"value_name": "author",
"info": "author name is a bit too cringe"
}
Not Found
The error when a client requests a resource that does not exist.
Field | Type | Description |
---|---|---|
type | “NOT_FOUND” | The type of this ErrorResponse variant. |
status | u16 | The HTTP status of the error. |
message | String | A brief explanation of the error. |
Example
{
"type": "NOT_FOUND",
"status": 404,
"message": "The requested resource could not be found"
}
Server
The error when the server fails to process a request.
Getting this error means that it’s the server’s fault and not the client that the request failed.
Field | Type | Description |
---|---|---|
type | “SERVER” | The type of this ErrorResponse variant. |
status | u16 | The HTTP status of the error. |
message | String | A brief explanation of the error. |
info | String | Extra information about what went wrong. |
Example
{
"type": "SERVER",
"status": 500,
"message": "Server encountered an unexpected error",
"info": "Server got stabbed 28 times"
}