keyring/
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
use thiserror::Error;

/// The global `Result` alias of the library.
pub type Result<T> = std::result::Result<T, Error>;

/// The global `Error` enum of the library.
#[derive(Debug, Error)]
pub enum Error {
    #[error("cannot build keyring entry using key `{1}`")]
    BuildEntryError(#[source] native::Error, String),
    #[error("cannot get secret from keyring matching `{1}`")]
    GetSecretError(#[source] native::Error, String),
    #[error("cannot find secret from keyring matching `{1}`")]
    FindSecretError(#[source] native::Error, String),
    #[error("cannot set secret from keyring matching `{1}`")]
    SetSecretError(#[source] native::Error, String),
    #[error("cannot delete secret from keyring matching `{1}`")]
    DeleteSecretError(#[source] native::Error, String),

    #[cfg(feature = "tokio")]
    #[error(transparent)]
    JoinError(#[from] tokio::task::JoinError),
}