stint_core/error.rs
1//! Top-level error types for Stint.
2
3use crate::storage::error::StorageError;
4
5/// Errors that can occur in Stint operations.
6#[derive(Debug, thiserror::Error)]
7pub enum StintError {
8 /// An error originating from the storage layer.
9 #[error(transparent)]
10 Storage(#[from] StorageError),
11
12 /// The caller provided invalid input.
13 #[error("invalid input: {0}")]
14 InvalidInput(String),
15
16 /// A timer is already running for the given project.
17 #[error("timer already running for project {0}")]
18 TimerAlreadyRunning(String),
19
20 /// No timer is currently running.
21 #[error("no timer is currently running")]
22 NoRunningTimer,
23
24 /// The project is archived and cannot be used for tracking.
25 #[error("project '{0}' is archived")]
26 ProjectNotActive(String),
27}