1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*!
 Errors that can happen when parsing query context data.
*/

use std::fmt::{Display, Formatter, Result};

/// Errors that can happen when parsing query context data
#[derive(Debug)]
pub enum QueryContextError {
    InvalidDate(String),
}

impl Display for QueryContextError {
    fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
        match self {
            QueryContextError::InvalidDate(date) => write!(
                fmt,
                "Invalid date provided: {date}! Must be in format YYYY-MM-DD."
            ),
        }
    }
}