1use crate::movement::MovementId;
2use crate::subsystem::Subsystem;
3
4#[derive(Debug, thiserror::Error)]
5pub enum MovementError {
6 #[error("Movement Cache Error: Movement missing from cache ({id})")]
7 CacheError { id: MovementId },
8
9 #[error("Movement Creation Error: {e}")]
10 CreationError { e: anyhow::Error },
11
12 #[error("Incorrect Pending Status: Attempt to incorrectly set movement status to pending")]
13 IncorrectPendingStatus,
14
15 #[error("Invalid Movement ID: {id} does not exist")]
16 InvalidMovementId { id: MovementId },
17
18 #[error("Movement Load Error: Unable to load movement ({id}) from persister: {e}")]
19 LoadError { id: MovementId, e: anyhow::Error },
20
21 #[error("Persist Movement Failed: Unable to persist changes to movement ({id}): {e}")]
22 PersisterError { id: MovementId, e: anyhow::Error },
23
24 #[error("Subsystem Error ({id}): {error}")]
25 SubsystemError { id: Subsystem, error: String },
26}