summaryrefslogtreecommitdiffstats
path: root/src/error.rs
blob: d98e7161e08af9ac8a499d9991d07590a3fab971 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use thiserror::Error;

#[derive(Debug, Clone, Error)]
pub enum VObjectErrorKind {
    #[error("Parser error: {}", _0)]
    ParserError(String),

    #[error("Not a Vcard")]
    NotAVCard,

    #[error("Not a Icalendar: {}", _0)]
    NotAnICalendar(String),

    #[cfg(feature = "timeconversions")]
    #[error("{}", _0)]
    ChronoError(::chrono::format::ParseError),
}

pub(crate) type VObjectResult<T> = Result<T, VObjectErrorKind>;