Errors

All error messages in Eludris come in one format as follows:

FieldTypeDescription
statusNumberThe status code of the error.
messageStringA message which explains the error.
data?ObjectThe error's associated data.

Example

/* An error without data */
{
  "status": 404,
  "message": "The requested resource cannot be found"
}
/* An error with data */
{
  "status": 429,
  "message": "You have been rate limited",
  "data": {
      "retry_after": 42069,
    }
}

RateLimitedError

The error raised when the client is rate limited.

FieldTypeDescription
retry_afterNumberThe number of milliseconds the client should wait before making new requests.

Example

{
  "status": 429,
  "message": "You have been rate limited",
  "data": {
    "retry_after": 42069
  }
}

FileSizeRateLimitedError

The error raised when the client surpasses the maximum amount of bytes and is rate limited.

FieldTypeDescription
retry_afterNumberThe number of milliseconds the client should wait before making new requests.
bytes_leftNumberThe number of bytes the client has available until the rate limit resets.

Example

{
  "status": 429,
  "message": "You have surpassed your file size limit",
  "data": {
    "retry_after": 42069,
    "bytes_left": 1337
  }
}

ValidationError

The error raised when the supplied request body is invalid.

FieldTypeDescription
field_nameStringThe name of the field that raised the error.
errorStringThe error that occurred.

Example

{
  "status": 422,
  "message": "Invalid request body",
  "data": {
    "field_name": "content",
    "error": "I disagree with your opinion"
  }
}

NotFoundError

The error raised when the requested resource could not be found.

This error has no special data.

Example

{
  "status": 404,
  "message": "The requested resource cannot be found"
}

ServerError

The error raised when an internal server error occurs.

FieldTypeDescription
errorStringThe name of the field that raised the error.

Example

{
  "status": 500,
  "message": "The server encountered an error while performing the requested action",
  "data": {
    "error": "Shine didn't confirm ;-;"
  }
}