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 = field(default=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] = 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 = field(default=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
#
headers: Headers = field()
The headers received in the error response.
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 #
Bases: KeyboardInterrupt
, HikariError
Exception raised when a kill signal is handled internally.
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 = field(default=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 pre-emptively 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.
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.
ShardCloseCode #
UnauthorizedError #
Bases: ClientHTTPResponseError
Raised when you are not authorized to access a specific resource.
status class-attribute
instance-attribute
#
status: HTTPStatus = field(default=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.