1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum TimeError {
8 #[error("Temporal entity not found: {0}")]
10 NotFound(String),
11
12 #[error("Invalid time range: start {start} is after end {end}")]
14 InvalidRange {
15 start: String,
17 end: String,
19 },
20
21 #[error("Deadline already passed: {0}")]
23 DeadlinePassed(String),
24
25 #[error("Schedule conflict: {0} overlaps with {1}")]
27 ScheduleConflict(String, String),
28
29 #[error("Sequence dependency not met: step {step} depends on {dependency}")]
31 DependencyNotMet {
32 step: String,
34 dependency: String,
36 },
37
38 #[error("Invalid recurrence pattern: {0}")]
40 InvalidRecurrence(String),
41
42 #[error("Invalid duration: {0}")]
44 InvalidDuration(String),
45
46 #[error("File format error: {0}")]
48 FileFormat(String),
49
50 #[error("IO error: {0}")]
52 Io(#[from] std::io::Error),
53
54 #[error("Serialization error: {0}")]
56 Serialization(#[from] serde_json::Error),
57}
58
59pub type TimeResult<T> = Result<T, TimeError>;