#[non_exhaustive]pub enum GatewayError {
Show 13 variants
BuildingUrl,
Closed(Option<CloseFrame<'static>>),
ExpectedHello,
HeartbeatFailed,
InvalidAuthentication,
InvalidHandshake,
InvalidShardData,
NoAuthentication,
NoSessionId,
OverloadedShard,
ReconnectFailure,
InvalidGatewayIntents,
DisallowedGatewayIntents,
}
Expand description
An error that occurred while attempting to deal with the gateway.
Note that - from a user standpoint - there should be no situation in which you manually handle these.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BuildingUrl
There was an error building a URL.
Closed(Option<CloseFrame<'static>>)
The connection closed, potentially uncleanly.
ExpectedHello
Expected a Hello during a handshake
HeartbeatFailed
When there was an error sending a heartbeat.
InvalidAuthentication
When invalid authentication (a bad token) was sent in the IDENTIFY.
InvalidHandshake
Expected a Ready or an InvalidateSession
InvalidShardData
When invalid sharding data was sent in the IDENTIFY.
§Examples
Sending a shard ID of 5 when sharding with 3 total is considered invalid.
NoAuthentication
When no authentication was sent in the IDENTIFY.
NoSessionId
When a session Id was expected (for resuming), but was not present.
OverloadedShard
When a shard would have too many guilds assigned to it.
§Examples
When sharding 5500 guilds on 2 shards, at least one of the shards will have over the maximum number of allowed guilds per shard.
This limit is currently 2500 guilds per shard.
ReconnectFailure
Failed to reconnect after a number of attempts.
InvalidGatewayIntents
When undocumented gateway intents are provided.
DisallowedGatewayIntents
When disallowed gateway intents are provided.
If an connection has been established but privileged gateway intents were provided without enabling them prior.