eventix/
error.rs

1//! Error types for the eventix library
2
3use thiserror::Error;
4
5/// Result type alias for eventix operations
6pub type Result<T> = std::result::Result<T, EventixError>;
7
8/// Error types that can occur in eventix operations
9#[derive(Error, Debug)]
10pub enum EventixError {
11    /// Error parsing date/time strings
12    #[error("Failed to parse date/time: {0}")]
13    DateTimeParse(String),
14
15    /// Error parsing timezone
16    #[error("Invalid timezone: {0}")]
17    InvalidTimezone(String),
18
19    /// Error with recurrence rules
20    #[error("Recurrence error: {0}")]
21    RecurrenceError(String),
22
23    /// Error during ICS operations
24    #[error("ICS error: {0}")]
25    IcsError(String),
26
27    /// Error with event validation
28    #[error("Event validation error: {0}")]
29    ValidationError(String),
30
31    /// IO errors
32    #[error("IO error: {0}")]
33    IoError(#[from] std::io::Error),
34
35    /// Generic error
36    #[error("{0}")]
37    Other(String),
38}