Skip to main content

crispy_catchup/
error.rs

1//! Catchup error types.
2
3/// Errors that can occur during catchup URL generation or validation.
4#[derive(Debug, thiserror::Error)]
5pub enum CatchupError {
6    /// The catchup mode is disabled for this channel.
7    #[error("catchup is disabled for this channel")]
8    Disabled,
9
10    /// The catchup source template is empty or invalid.
11    #[error("invalid catchup source: {0}")]
12    InvalidSource(String),
13
14    /// The requested time is outside the catchup window.
15    #[error("requested time {requested} is outside the catchup window of {window_days} days")]
16    OutsideWindow { requested: i64, window_days: i32 },
17
18    /// Failed to parse a provider URL (Flussonic or Xtream Codes).
19    #[error("failed to parse {provider} URL: {url}")]
20    UrlParseFailed { provider: String, url: String },
21
22    /// A regex compilation error.
23    #[error("regex error: {0}")]
24    Regex(#[from] regex::Error),
25}