Exceptions and warnings that can be thrown by this library.
- exception hikari.errors.BadRequestError#
Raised when you send an invalid request somehow.
- errors: Optional[Mapping[str, hikari.internal.data_binding.JSONObject]]#
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.
- exception hikari.errors.BulkDeleteError#
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.
- exception hikari.errors.ClientHTTPResponseError#
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.
- exception hikari.errors.ComponentStateConflictError#
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.
- exception hikari.errors.ForbiddenError#
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.
- exception hikari.errors.GatewayConnectionError#
An exception thrown if a connection issue occurs.
- exception hikari.errors.GatewayError#
A base exception type for anything that can be thrown by the Gateway.
- exception hikari.errors.GatewayServerClosedConnectionError#
An exception raised when the server closes the connection.
- can_reconnect: bool#
Trueif we can recover from this closure.
True, it will try to reconnect after this is raised rather than it being propagated to the caller. If
False, this will be raised, thus stopping the application unless handled explicitly by the user.
- exception hikari.errors.HTTPError#
Base exception raised if an HTTP error occurs while making a request.
- exception hikari.errors.HTTPResponseError#
Base exception for an erroneous HTTP response.
- headers: hikari.internal.data_binding.Headers#
The headers received in the error response.
- raw_body: Any#
The response body.
- status: Union[http.HTTPStatus, int]#
The HTTP status code for the response.
This will be
intif it’s outside the range of status codes in the HTTP specification (e.g. one of Cloudflare’s non-standard status codes).
- exception hikari.errors.HikariError#
Base for an error raised by this API.
Any exceptions should derive from this.
You should never initialize this exception directly.
- exception hikari.errors.HikariInterrupt#
Exception raised when a kill signal is handled internally.
- exception hikari.errors.HikariWarning#
Base for a warning raised by this API.
Any warnings should derive from this.
You should never initialize this warning directly.
- exception hikari.errors.InternalServerError#
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!
- exception hikari.errors.MissingIntentError#
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.
- exception hikari.errors.MissingIntentWarning#
Warning raised when subscribing to an event that cannot be fired.
This is caused by your application missing certain intents.
- exception hikari.errors.NotFoundError#
Raised when something is not found.
- exception hikari.errors.RateLimitTooLongError#
Internal error raised if the wait for a rate limit is too long.
This is similar to
asyncio.TimeoutErrorin 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.
- property remaining: Literal#
Remaining requests in this window.
This will always be
- exception hikari.errors.RateLimitedError#
Raised when a non-global rate limit that cannot be handled occurs.
If you receive one of these, you should NOT try again until the given time has passed, either discarding the operation you performed, or waiting until the given time has passed first. Note that it may still be valid to send requests with different attributes in them.
A use case for this by Discord appears to be to stop abuse from bots that change channel names, etc, regularly. This kind of action allegedly causes a fair amount of overhead internally for Discord. In the case you encounter this, you may be able to send different requests that manipulate the same entities (in this case editing the same channel) that do not use the same collection of attributes as the previous request.
- retry_after: float#
How many seconds to wait before you can reuse the route with the specific request.
Raised when you are not authorized to access a specific resource.
The HTTP status code for the response.
- exception hikari.errors.UnrecognisedEntityError#
An exception thrown when an unrecognised entity is found.
- exception hikari.errors.VoiceError#
Error raised when a problem occurs with the voice subsystem.