Skip to main content

caldir_core/calendar/
error.rs

1use std::path::PathBuf;
2
3use super::config::CalendarConfigError;
4use super::state::CalendarStateError;
5use crate::calendar::CalendarEventError;
6
7#[derive(Debug, thiserror::Error)]
8#[non_exhaustive]
9pub enum CalendarError {
10    #[error("calendar already exists at: {0}")]
11    AlreadyExists(PathBuf),
12
13    #[error("calendar not found at: {0}")]
14    NotFound(PathBuf),
15
16    #[error(transparent)]
17    Io(#[from] std::io::Error),
18
19    #[error(transparent)]
20    Config(#[from] CalendarConfigError),
21
22    #[error(transparent)]
23    State(#[from] CalendarStateError),
24
25    #[error(transparent)]
26    Event(#[from] CalendarEventError),
27
28    #[error("master event not found: {0}")]
29    MasterNotFound(String),
30
31    #[error("event {0} is not recurring")]
32    NotRecurring(String),
33}