diff options
Diffstat (limited to '')
| -rw-r--r-- | src/domain/error.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/domain/error.rs b/src/domain/error.rs new file mode 100644 index 0000000..4602b7e --- /dev/null +++ b/src/domain/error.rs @@ -0,0 +1,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, +} |