caldav_utils/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum CaldavError {
5    #[error(transparent)]
6    Anyhow(#[from] anyhow::Error),
7    #[error(transparent)]
8    ChronoParse(#[from] chrono::ParseError),
9    #[error("Calendar not found: {calendar_name}")]
10    CalendarNotFound { calendar_name: String },
11    #[error(transparent)]
12    InvalidMethod(#[from] http::method::InvalidMethod),
13    #[error(transparent)]
14    Minidom(#[from] minidom::Error),
15    #[error(transparent)]
16    Reqwest(#[from] reqwest::Error),
17    #[error(transparent)]
18    RRule(#[from] rrule::RRuleError),
19    #[error("Error calling caldav server: {0}")]
20    ServerResponse(String),
21}
22
23pub type CaldavResult<T> = Result<T, CaldavError>;