Skip to main content

primitives/correlated_randomness/stream/
errors.rs

1use serde::{Deserialize, Serialize};
2use wincode::{SchemaRead, SchemaWrite};
3
4#[derive(
5    Debug, Clone, PartialEq, Eq, thiserror::Error, Serialize, Deserialize, SchemaRead, SchemaWrite,
6)]
7pub enum CorrelatedStreamError {
8    #[error("Correlated data stream closed.")]
9    StreamClosed,
10    #[error("RecvError: {0}")]
11    RecvError(String),
12    #[error("SendError: {0}")]
13    SendError(String),
14    #[error("Rate limit exceeded - too many requests")]
15    RateLimitExceeded,
16    #[error("Request too large: requested {requested}, max allowed {max_allowed}")]
17    RequestTooLarge {
18        requested: usize,
19        max_allowed: usize,
20    },
21    #[error("Timed out acquiring config lock after {timeout_ms}ms")]
22    LockTimeout { timeout_ms: u64 },
23}