guts_storage/
error.rs

1//! Storage error types.
2
3use thiserror::Error;
4
5/// Errors that can occur during storage operations.
6#[derive(Debug, Error)]
7pub enum StorageError {
8    /// Object not found in storage.
9    #[error("object not found: {0}")]
10    ObjectNotFound(String),
11
12    /// Reference not found.
13    #[error("reference not found: {0}")]
14    RefNotFound(String),
15
16    /// Repository not found.
17    #[error("repository not found: {0}")]
18    RepoNotFound(String),
19
20    /// Repository already exists.
21    #[error("repository already exists: {0}")]
22    RepoExists(String),
23
24    /// Invalid object format.
25    #[error("invalid object: {0}")]
26    InvalidObject(String),
27
28    /// Invalid reference name.
29    #[error("invalid reference: {0}")]
30    InvalidRef(String),
31
32    /// Compression/decompression error.
33    #[error("compression error: {0}")]
34    Compression(String),
35
36    /// I/O error.
37    #[error("I/O error: {0}")]
38    Io(#[from] std::io::Error),
39}