Error Response
All the possible error responses that are returned from Eludris HTTP microservices.
UNAUTHORIZED
The error when the client is missing authorization. This error often occurs when the user doesn’t pass in the required authentication or passes in invalid credentials.
Field | Type | Description |
---|---|---|
type | "UNAUTHORIZED" | The type of this Error Response variant. |
status | Number | The HTTP status of the error. |
message | String | A brief explanation of the error. |
Example
{
"type": "UNAUTHORIZED",
"status": 401,
"message": "The user is missing authentication or the passed credentials are invalid"
}
FORBIDDEN
The error when a client has been succesfully authorized but does not have the required permissions to execute an action.
Field | Type | Description |
---|---|---|
type | "FORBIDDEN" | The type of this Error Response variant. |
status | Number | The HTTP status of the error. |
message | String | A brief explanation of the error. |
Example
{
"type": "FORBIDDEN",
"status": 403,
"message": "The user is missing the requried permissions to execute this action",
}
NOT_FOUND
The error when a client requests a resource that does not exist.
Field | Type | Description |
---|---|---|
type | "NOT_FOUND" | The type of this Error Response variant. |
status | Number | 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"
}
CONFLICT
The error when a client’s request causes a conflict, usually when they’re trying to create something that already exists.
Field | Type | Description |
---|---|---|
type | "CONFLICT" | The type of this Error Response variant. |
status | Number | The HTTP status of the error. |
message | String | A brief explanation of the error. |
item | String | The conflicting item. |
Example
{
"type": "CONFLICT",
"status": 409,
"message": "The request couldn't be completed due to conflicting with other data on the server",
"item": "username",
}
MISDIRECTED
The error when a server isn’t able to reduce a response even though the client’s request isn’t explicitly wrong. This usually happens when an instance isn’t configured to provide a response.
Field | Type | Description |
---|---|---|
type | "MISDIRECTED" | The type of this Error Response variant. |
status | Number | The HTTP status of the error. |
message | String | A brief explanation of the error. |
info | String | Extra information about what went wrong. |
Example
{
"type": "MISDIRECTED",
"status": 421,
"message": "Misdirected request",
"info": "The instance isn't configured to deal with unbased individuals"
}
VALIDATION
The error when a request a client sends is incorrect and fails validation.
Field | Type | Description |
---|---|---|
type | "VALIDATION" | The type of this Error Response variant. |
status | Number | 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"
}
RATE_LIMITED
The error when a client is rate limited.
Field | Type | Description |
---|---|---|
type | "RATE_LIMITED" | The type of this Error Response variant. |
status | Number | The HTTP status of the error. |
message | String | A brief explanation of the error. |
retry_after | Number | The amount of milliseconds you’re still rate limited for. |
Example
{
"type": "RATE_LIMITED",
"status": 429,
"message": "You have been rate limited",
"retry_after": 1234
}
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 Error Response variant. |
status | Number | 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"
}