Skip to main content

hitbox_feoxdb/
error.rs

1use bincode::error::{DecodeError, EncodeError};
2use feoxdb::FeoxError;
3use thiserror::Error;
4
5/// Errors that can occur when using [`FeOxDbBackend`](crate::FeOxDbBackend).
6#[derive(Debug, Error)]
7pub enum FeOxDbError {
8    /// An error from the underlying FeOxDB database.
9    #[error("FeOxDB error: {0}")]
10    FeOxDb(#[from] FeoxError),
11
12    /// Failed to serialize a cache key or value.
13    #[error("Serialization error: {0}")]
14    Serialization(#[from] EncodeError),
15
16    /// Failed to deserialize a cache key or value.
17    #[error("Deserialization error: {0}")]
18    Deserialization(#[from] DecodeError),
19
20    /// An I/O error occurred while accessing the database file.
21    #[error("IO error: {0}")]
22    Io(#[from] std::io::Error),
23
24    /// The provided configuration is invalid.
25    #[error("Invalid configuration: {0}")]
26    InvalidConfig(String),
27}