Enum serenity::gateway::GatewayError[][src]

#[non_exhaustive]
pub enum GatewayError {
Show 14 variants BuildingUrl, Closed(Option<CloseFrame<'static>>), ExpectedHello, HeartbeatFailed, InvalidAuthentication, InvalidHandshake, InvalidOpCode, 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

BuildingUrl

There was an error building a URL.

Closed(Option<CloseFrame<'static>>)

Tuple Fields

0: 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

InvalidOpCode

An indicator that an unknown opcode was received from the gateway.

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 gatewax intents are provided.

If an connection has been established but priviliged gateway intents were provided without enabling them prior.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more