Skip to main content

griz_store/
error.rs

1//! Store failures.
2
3/// Why a store call failed.
4#[derive(Debug, thiserror::Error)]
5pub enum StoreError {
6    /// The database failed.
7    #[error("database: {0}")]
8    Sqlite(#[from] rusqlite::Error),
9    /// The filesystem failed.
10    #[error("filesystem: {0}")]
11    Io(#[from] std::io::Error),
12    /// A stored record could not be decoded.
13    #[error("record: {0}")]
14    Json(#[from] serde_json::Error),
15    /// No record has this identifier.
16    #[error("not found: {0}")]
17    NotFound(String),
18    /// The request cannot be satisfied as asked.
19    #[error("{0}")]
20    Invalid(String),
21}