Skip to main content

fanduel_data/
error.rs

1/// Errors returned while parsing FanDuel salary CSV files or accessing salary data.
2#[derive(Debug, thiserror::Error)]
3pub enum FanduelDataError {
4    /// The CSV could not be read or deserialized.
5    #[error("CSV error: {0}")]
6    Csv(#[from] csv::Error),
7    /// A SQLite operation failed.
8    #[error("database error: {0}")]
9    Sqlx(#[from] sqlx::Error),
10    /// Applying database migrations failed.
11    #[error("migration error: {0}")]
12    Migration(#[from] sqlx::migrate::MigrateError),
13    /// A CSV row contains invalid or unsupported FanDuel data.
14    #[error("invalid FanDuel CSV row: {0}")]
15    InvalidRow(String),
16    /// A game matchup could not be parsed.
17    #[error("invalid matchup: {0}")]
18    MatchupParseError(String),
19}