>>

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.

FieldTypeDescription
type"UNAUTHORIZED"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA 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.

FieldTypeDescription
type"FORBIDDEN"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA 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.

FieldTypeDescription
type"NOT_FOUND"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA 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.

FieldTypeDescription
type"CONFLICT"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA brief explanation of the error.
itemStringThe 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.

FieldTypeDescription
type"MISDIRECTED"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA brief explanation of the error.
infoStringExtra 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.

FieldTypeDescription
type"VALIDATION"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA brief explanation of the error.
value_nameStringThe name of the value that failed validation.
infoStringExtra 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.

FieldTypeDescription
type"RATE_LIMITED"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA brief explanation of the error.
retry_afterNumberThe 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.

FieldTypeDescription
type"SERVER"The type of this Error Response variant.
statusNumberThe HTTP status of the error.
messageStringA brief explanation of the error.
infoStringExtra information about what went wrong.
>>

Example

{
  "type": "SERVER",
  "status": 500,
  "message": "Server encountered an unexpected error",
  "info": "Server got stabbed 28 times"
}