samod_core/actors/document/
errors.rs1use std::fmt;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum DocumentError {
6 DocumentNotReady,
8 InvalidState(String),
9}
10
11impl fmt::Display for DocumentError {
12 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13 match self {
14 DocumentError::DocumentNotReady => {
15 write!(f, "Document is not yet ready for operations")
16 }
17 DocumentError::InvalidState(msg) => {
18 write!(f, "Invalid state: {msg}")
19 }
20 }
21 }
22}
23
24impl std::error::Error for DocumentError {}