Skip to main content

caldir_core/event/
error.rs

1use std::path::PathBuf;
2
3#[derive(Debug, thiserror::Error)]
4#[non_exhaustive]
5pub enum EventError {
6    #[error("failed to read event from {0}")]
7    Io(PathBuf, #[source] std::io::Error),
8
9    #[error("failed to parse ICS {0}: {1}")]
10    InvalidIcs(String, String),
11
12    #[error("expected {expected} event(s) in ICS, found {found}")]
13    UnexpectedEventCount { expected: usize, found: usize },
14
15    #[error("event is missing a start time (DTSTART)")]
16    MissingStart,
17
18    #[error("event is missing a UID")]
19    MissingUid,
20
21    #[error("no attendee matching {email}")]
22    AttendeeNotFound { email: String },
23}