primitives/correlated_randomness/stream/
errors.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error, Serialize, Deserialize)]
4pub enum CorrelatedStreamError {
5 #[error("Correlated data stream closed.")]
6 StreamClosed,
7 #[error("RecvError: {0}")]
8 RecvError(String),
9 #[error("SendError: {0}")]
10 SendError(String),
11 #[error("Rate limit exceeded - too many requests")]
12 RateLimitExceeded,
13 #[error("Request too large: requested {requested}, max allowed {max_allowed}")]
14 RequestTooLarge {
15 requested: usize,
16 max_allowed: usize,
17 },
18 #[error("Timed out acquiring config lock after {timeout_ms}ms")]
19 LockTimeout { timeout_ms: u64 },
20 #[error("Resync target {target} is behind the current position {current}")]
21 ResyncRewind { current: u64, target: u64 },
22 #[error("A resync is already in progress")]
23 ResyncInProgress,
24 #[error(
25 "Resync to {target} requires advancing past the generated position {generated}, but the \
26 generator does not support unilateral skipping (likely a generation desync)"
27 )]
28 ResyncUnsupported { generated: u64, target: u64 },
29 #[error(
30 "Skip of {requested} exceeds the {available} cached elements (would require generating)"
31 )]
32 SkipExceedsCache { available: usize, requested: usize },
33}