secret/
error.rs

1//! # Error
2//!
3//! Module dedicated to secret errors. It contains an [`Error`] enum
4//! based on [`thiserror::Error`] and a type alias [`Result`].
5
6use thiserror::Error;
7
8/// The global `Result` alias of the library.
9pub type Result<T> = std::result::Result<T, Error>;
10
11/// The global `Error` enum of the library.
12#[derive(Debug, Error)]
13pub enum Error {
14    #[error("cannot get empty secret")]
15    GetEmptySecretError,
16    #[cfg(feature = "command")]
17    #[error("cannot get secret from command")]
18    GetSecretFromCommand(#[source] process::Error),
19    #[cfg(feature = "command")]
20    #[error("cannot get secret from command: empty output")]
21    GetSecretFromCommandEmptyOutputError,
22
23    #[cfg(feature = "keyring")]
24    #[error(transparent)]
25    KeyringError(#[from] keyring::Error),
26}