hikari.errors#
Exceptions and warnings that can be thrown by this library.
BadRequestError #
Bases: ClientHTTPResponseError
Raised when you send an invalid request somehow.
errors class-attribute instance-attribute #
Dict of top level field names to field specific error paths.
For more information, this error format is loosely defined at https://discord.com/developers/docs/reference#error-messages and is commonly returned for 50035 errors.
status class-attribute instance-attribute #
status: HTTPStatus = attrs.field(
default=http.HTTPStatus.BAD_REQUEST, init=False
)
The HTTP status code for the response.
BulkDeleteError #
Bases: HikariError
Exception raised when a bulk delete fails midway through a call.
This will contain the list of message items that failed to be deleted, and will have a cause containing the initial exception.
deleted_messages class-attribute instance-attribute #
deleted_messages: SnowflakeishSequence[PartialMessage] = (
attrs.field()
)
Any message objects that were deleted before an exception occurred.
ClientHTTPResponseError #
Bases: HTTPResponseError
Base exception for an erroneous HTTP response that is a client error.
All exceptions derived from this base should be treated as 4xx client errors when encountered.
ComponentStateConflictError #
Bases: HikariError
Exception thrown when an action cannot be executed in the component's current state.
Dependent on context this will be thrown for components which are already running or haven't been started yet.
ForbiddenError #
Bases: ClientHTTPResponseError
Raised when you are not allowed to access a specific resource.
This means you lack the permissions to do something, either because of permissions set in a guild, or because your application is not whitelisted to use a specific endpoint.
status class-attribute instance-attribute #
status: HTTPStatus = attrs.field(
default=http.HTTPStatus.FORBIDDEN, init=False
)
The HTTP status code for the response.
GatewayConnectionError #
GatewayError #
Bases: HikariError
A base exception type for anything that can be thrown by the Gateway.
GatewayServerClosedConnectionError #
Bases: GatewayError
An exception raised when the server closes the connection.
GatewayTransportError #
HTTPError #
Bases: HikariError
Base exception raised if an HTTP error occurs while making a request.
HTTPResponseError #
Bases: HTTPError
Base exception for an erroneous HTTP response.
headers class-attribute instance-attribute #
The headers received in the error response.
message class-attribute instance-attribute #
The error message.
HikariError #
Bases: RuntimeError
Base for an error raised by this API.
Any exceptions should derive from this.
Note
You should never initialize this exception directly.
HikariInterrupt #
HikariWarning #
Bases: RuntimeWarning
Base for a warning raised by this API.
Any warnings should derive from this.
Note
You should never initialize this warning directly.
InternalServerError #
Bases: HTTPResponseError
Base exception for an erroneous HTTP response that is a server error.
All exceptions derived from this base should be treated as 5xx server errors when encountered. If you get one of these, it is not your fault!
MissingIntentError #
Bases: HikariError, ValueError
Error raised when you try to perform an action without an intent.
This is usually raised when querying the cache for something that is unavailable due to certain intents being disabled.
MissingIntentWarning #
Bases: HikariWarning
Warning raised when subscribing to an event that cannot be fired.
This is caused by your application missing certain intents.
NotFoundError #
Bases: ClientHTTPResponseError
Raised when something is not found.
status class-attribute instance-attribute #
status: HTTPStatus = attrs.field(
default=http.HTTPStatus.NOT_FOUND, init=False
)
The HTTP status code for the response.
RateLimitTooLongError #
Bases: HTTPError
Internal error raised if the wait for a rate limit is too long.
This is similar to asyncio.TimeoutError in the way that it is used, but this will be raised preemptively and immediately if the period of time needed to wait is greater than a user-defined limit.
This will almost always be route-specific. If you receive this, it is unlikely that performing the same call for a different channel/guild/user will also have this rate limit.
is_global class-attribute instance-attribute #
Whether the ratelimit is global.
limit class-attribute instance-attribute #
The maximum number of calls per window for this rate limit, if known.
max_retry_after class-attribute instance-attribute #
How long the client is allowed to wait for at a maximum before raising.
message class-attribute instance-attribute #
The error message.
period class-attribute instance-attribute #
How long the rate limit window lasts for from start to end, if known.
remaining property #
remaining: Literal[0]
Remaining requests in this window.
This will always be 0 symbolically.
reset_at class-attribute instance-attribute #
UNIX timestamp of when this limit will be lifted.
retry_after class-attribute instance-attribute #
How many seconds to wait before you can retry this specific request.
SearchNotIndexedError #
Bases: HikariError
An exception thrown when the search index for the entity is not yet available.
The request should be retried after hikari.errors.SearchNotIndexedError.retry_after seconds.
documents_indexed class-attribute instance-attribute #
The number of documents that have been indexed so far.
ShardCloseCode #
Bases: int, Enum
Reasons for a shard connection closure.
ALREADY_AUTHENTICATED class-attribute instance-attribute #
ALREADY_AUTHENTICATED = 4005
A code indicating that more than one identifying payload were sent.
AUTHENTICATION_FAILED class-attribute instance-attribute #
AUTHENTICATION_FAILED = 4004
A code indicating that the token sent for identifying is incorrect.
DECODE_ERROR class-attribute instance-attribute #
DECODE_ERROR = 4002
A code indicating that an invalid payload was sent.
DISALLOWED_INTENT class-attribute instance-attribute #
DISALLOWED_INTENT = 4014
A code indicating that (a) disallowed intent(s) had been sent.
ENCODING_ERROR class-attribute instance-attribute #
ENCODING_ERROR = 1007
A code indicating that invalid data was received.
GOING_AWAY class-attribute instance-attribute #
GOING_AWAY = 1001
A code indicating that the server is going down or the gateway is restarting.
INVALID_INTENT class-attribute instance-attribute #
INVALID_INTENT = 4013
A code indicating that invalid intents were sent.
INVALID_SEQ class-attribute instance-attribute #
INVALID_SEQ = 4007
A code indicating that the sequence sent when resuming the session is invalid.
INVALID_SHARD class-attribute instance-attribute #
INVALID_SHARD = 4010
A code indicating that an invalid shard was sent for identifying.
INVALID_VERSION class-attribute instance-attribute #
INVALID_VERSION = 4012
A code indicating that an invalid API version was sent.
NORMAL_CLOSURE class-attribute instance-attribute #
NORMAL_CLOSURE = 1000
A code indicating that the connection has been closed normally.
NOT_AUTHENTICATED class-attribute instance-attribute #
NOT_AUTHENTICATED = 4003
A code indicating that either a payload was sent before identifying, or the session has been invalidated.
POLICY_VIOLATION class-attribute instance-attribute #
POLICY_VIOLATION = 1008
A code indicating that a policy has been violated.
PROTOCOL_ERROR class-attribute instance-attribute #
PROTOCOL_ERROR = 1002
A code indicating that a protocol error has occurred.
RATE_LIMITED class-attribute instance-attribute #
RATE_LIMITED = 4008
A code indicating that payloads were sent too quickly resulting in a disconnect.
SESSION_TIMEOUT class-attribute instance-attribute #
SESSION_TIMEOUT = 4009
A code indicating that the session has timed out.
SHARDING_REQUIRED class-attribute instance-attribute #
SHARDING_REQUIRED = 4011
A code indicating that sharding is required due to having too many guilds.
TOO_BIG class-attribute instance-attribute #
TOO_BIG = 1009
A code indicating that the message sent was too large.
TYPE_ERROR class-attribute instance-attribute #
TYPE_ERROR = 1003
A code indicating that unsupported data was received.
UNEXPECTED_CONDITION class-attribute instance-attribute #
UNEXPECTED_CONDITION = 1011
A code indicating that an unexpected condition was encountered, which prevented the request from being fulfilled.
UNKNOWN_ERROR class-attribute instance-attribute #
UNKNOWN_ERROR = 4000
A code indicating that something unknown has gone awry.
UNKNOWN_OPCODE class-attribute instance-attribute #
UNKNOWN_OPCODE = 4001
A code indicating that an unknown opcode was sent.
UnauthorizedError #
Bases: ClientHTTPResponseError
Raised when you are not authorized to access a specific resource.
status class-attribute instance-attribute #
status: HTTPStatus = attrs.field(
default=http.HTTPStatus.UNAUTHORIZED, init=False
)
The HTTP status code for the response.
UnrecognisedEntityError #
Bases: HikariError
An exception thrown when an unrecognised entity is found.
VoiceError #
Bases: HikariError
Error raised when a problem occurs with the voice subsystem.