aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
blob: a7c2e0d57b7f745ff8f2548759be604f88f8034a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use custom_error::custom_error;

custom_error! { pub Error
    DsbParse { msg: String } = "Failed to parse dsb: {msg}",
    DsbInvalidWeek{ value: String } = "Week {value} is invalid",
    DsbInvalidHour{ value: String } = "Hour {value} is invalid",
    InvalidRoom{ value: String } = "Room {value} is invalid",
    InvalidCourse { value: String} = "Course {value} is invalid",


    ChronoParse { source: chrono::ParseError } = "Chrono: {source}",
    Parse{ source: std::num::ParseIntError } = "Parser: {source}",
    Io{source: std::io::Error } = "IO: {source}"
}