floxide_core/error.rs
1use std::time::Duration;
2use thiserror::Error;
3
4#[derive(Debug, Error, Clone)]
5pub enum FloxideError {
6 #[error("Generic error: {0}")]
7 Generic(String),
8 /// The workflow was cancelled via its cancellation token.
9 #[error("Workflow cancelled")]
10 Cancelled,
11 /// The workflow timed out after the specified duration.
12 #[error("Workflow timed out after {0:?}")]
13 Timeout(Duration),
14 /// The workflow was never started, so cannot be resumed.
15 #[error("Workflow has not been started")]
16 NotStarted,
17 /// The workflow has already completed; no more work to resume.
18 #[error("Workflow already completed")]
19 AlreadyCompleted,
20}