sos_core/
error.rs

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
30
//! Errors generated by the core library.
use thiserror::Error;

/// Error thrown by the core library.
#[derive(Debug, Error)]
pub enum Error {
    /// Error generated when a commit tree is expected to have a root.
    #[error("commit tree does not have a root")]
    NoRootCommit,

    /// Error generated when a commit tree is expected to have a last commit.
    #[error("commit tree does not have a last commit")]
    NoLastCommit,

    /// Error generated when an external file could not be parsed.
    #[error("external file reference '{0}' could not be parsed")]
    InvalidExternalFile(String),

    /// Error generated converting to fixed length slice.
    #[error(transparent)]
    TryFromSlice(#[from] std::array::TryFromSliceError),

    /// Error generated converting from hexadecimal.
    #[error(transparent)]
    Hex(#[from] hex::FromHexError),

    /// Error generated converting from UUID.
    #[error(transparent)]
    Uuid(#[from] uuid::Error),
}