1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! Possible errors of a TAPLE Database
use thiserror::Error;

/// Errors that can be generated by Taple database implementations
#[derive(Error, Debug, Clone, PartialEq)]
pub enum Error {
    /// The entry does not exist in the database
    #[error("Entry Not Found")]
    EntryNotFound,
    /// A serialization error occurred when writing to the database.
    #[error("Error while serializing")]
    SerializeError,
    /// A deserialization error occurred while reading from the database.
    #[error("Error while deserializing")]
    DeserializeError,
    /// An error occurred while updating a subject in the database.
    #[error("Subject Apply failed")]
    SubjectApplyFailed,
    /// Conversion of a data to [DigestIdentifier] failed
    #[error("Conversion to Digest Identifier failed")]
    NoDigestIdentifier,
    #[error("Key Elements must have more than one element")]
    KeyElementsError,
    /// User-specifiable custom error
    #[error("An error withing the database custom implementation {0}")]
    CustomError(String),
    #[error("State non existent, possibilities are: Pending or Voted.")]
    NonExistentStatus,
}