reach_passphrase/
error.rs1use thiserror::Error;
5
6#[derive(Debug, Error, PartialEq, Eq)]
7pub enum PassphraseError {
8 #[error("Missing passphrase authentication code")]
9 MissingPassphraseAuthenticationCode,
10 #[error("Invalid passphrase authentication code")]
11 InvalidPassphraseAuthenticationCode,
12 #[error("Invalid segment count: {0}")]
13 InvalidSegmentCount(isize),
14 #[error("Words not found in word list: {0:?}")]
15 WordsNotFound(Vec<String>),
16 #[error("Encountered hashing error")]
17 HashError(argon2::Error),
18}
19
20impl From<argon2::Error> for PassphraseError {
21 fn from(from: argon2::Error) -> Self {
22 Self::HashError(from)
23 }
24}