rustywallet_mnemonic/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Clone, PartialEq, Eq, Error)]
7pub enum MnemonicError {
8 #[error("Invalid word count: {0}. Must be 12, 15, 18, 21, or 24")]
10 InvalidWordCount(usize),
11
12 #[error("Invalid word: '{0}' not in wordlist")]
14 InvalidWord(String),
15
16 #[error("Invalid checksum")]
18 InvalidChecksum,
19
20 #[error("Invalid entropy length: expected {expected}, got {actual}")]
22 InvalidEntropyLength { expected: usize, actual: usize },
23
24 #[error("Empty mnemonic phrase")]
26 EmptyPhrase,
27
28 #[error("Invalid private key derived from seed")]
30 InvalidPrivateKey,
31
32 #[error("Could not detect language: words may be from multiple languages")]
34 LanguageDetectionFailed,
35}