aboutsummaryrefslogtreecommitdiff
path: root/src/errors.rs
blob: be78bcf725d9e3679bbfdaba0198d82da119cb54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::num::ParseIntError;
use ical::parser;

#[derive(Debug)]
pub enum EventError {
    IcalError(parser::errors::Error),
    IntError(ParseIntError),
    StatusError,
    FreqError,
}

impl From<parser::errors::Error> for EventError {
    fn from(err: parser::errors::Error) -> EventError {
        EventError::IcalError(err)
    }
}

impl From<ParseIntError> for EventError {
    fn from(err: ParseIntError) -> EventError {
        EventError::IntError(err)
    }
}