Something went wrong. Try again.
Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
Something went wrong. Try again.
1.9 kB · 47 lines
Rust
at order_query
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748//! Various error types.use std::io;
use thiserror::Error;
/// Possible errors that can occur when a [JetstreamConfig](crate::JetstreamConfig) that is passed/// to a [JetstreamConnector](crate::JetstreamConnector) is invalid.#[derive(Error, Debug)]pub enum ConfigValidationError { #[error("too many wanted collections: {0} > 100")] TooManyWantedCollections(usize), #[error("too many wanted DIDs: {0} > 10,000")] TooManyDids(usize), #[error("invalid endpoint: {0}")] InvalidEndpoint(#[from] url::ParseError),}
/// Possible errors that can occur in the process of connecting to a Jetstream instance over/// WebSockets.////// See [JetstreamConnector::connect](crate::JetstreamConnector::connect).#[derive(Error, Debug)]pub enum ConnectionError { #[error("invalid endpoint: {0}")] InvalidEndpoint(#[from] url::ParseError), #[error("failed to construct url: {0}")] InvalidEndpointUri(#[from] tokio_tungstenite::tungstenite::http::uri::InvalidUri), #[error("failed to connect to Jetstream instance: {0}")] WebSocketFailure(#[from] tokio_tungstenite::tungstenite::Error), #[error("the Jetstream config is invalid (this really should not happen here): {0}")] InvalidConfig(#[from] ConfigValidationError),}
/// Possible errors that can occur when receiving events from a Jetstream instance over WebSockets.////// See [websocket_task](crate::websocket_task).#[derive(Error, Debug)]pub enum JetstreamEventError { #[error("failed to load built-in zstd dictionary for decoding: {0}")] CompressionDictionaryError(io::Error), #[error("failed to send ping or pong: {0}")] PingPongError(#[from] tokio_tungstenite::tungstenite::Error), #[error("no messages received within ttl")] NoMessagesReceived, #[error("jetstream event receiver closed")] ReceiverClosedError,}