taple_core/database/
error.rs

1//! Possible errors of a TAPLE Database
2use thiserror::Error;
3
4/// Errors that can be generated by Taple database implementations
5#[derive(Error, Debug, Clone, PartialEq)]
6pub enum Error {
7    /// The entry does not exist in the database
8    #[error("Entry Not Found")]
9    EntryNotFound,
10    /// A serialization error occurred when writing to the database.
11    #[error("Error while serializing")]
12    SerializeError,
13    /// A deserialization error occurred while reading from the database.
14    #[error("Error while deserializing")]
15    DeserializeError,
16    /// An error occurred while updating a subject in the database.
17    #[error("Subject Apply failed")]
18    SubjectApplyFailed,
19    /// Conversion of a data to [DigestIdentifier] failed
20    #[error("Conversion to Digest Identifier failed")]
21    NoDigestIdentifier,
22    #[error("Key Elements must have more than one element")]
23    KeyElementsError,
24    /// User-specifiable custom error
25    #[error("An error withing the database custom implementation {0}")]
26    CustomError(String),
27    #[error("State non existent, possibilities are: Pending or Voted.")]
28    NonExistentStatus,
29}