aboutsummaryrefslogtreecommitdiff
path: root/src/domain/error.rs
blob: 4602b7e16bd774919a54f095dacfbbf5bebaaa35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use thiserror::Error;

#[derive(Error, Debug)]
pub enum DomainError {
    #[error("Invalid time range: start time must be before end time")]
    InvalidTimeRange,

    #[error("Invalid color value")]
    InvalidColor,

    #[error("Invalid frequency")]
    InvalidFrequency,

    #[error("Invalid interval: must be greater than 0")]
    InvalidInterval,

    #[error("Calendar not found: {0}")]
    CalendarNotFound(String),

    #[error("Event not found: {0}")]
    EventNotFound(String),

    #[error("Recurrence not found: {0}")]
    RecurrenceNotFound(String),

    #[error("Cannot modify archived calendar")]
    CalendarArchived,
}