github.com/decred/dcrlnd@v0.7.6/aezeed/errors.go (about) 1 package aezeed 2 3 import "fmt" 4 5 var ( 6 // ErrIncorrectVersion is returned if a seed bares a mismatched 7 // external version to that of the package executing the aezeed scheme. 8 ErrIncorrectVersion = fmt.Errorf("wrong seed version") 9 10 // ErrInvalidPass is returned if the user enters an invalid passphrase 11 // for a particular enciphered mnemonic. 12 ErrInvalidPass = fmt.Errorf("invalid passphrase") 13 14 // ErrIncorrectMnemonic is returned if we detect that the checksum of 15 // the specified mnemonic doesn't match. This indicates the user input 16 // the wrong mnemonic. 17 ErrIncorrectMnemonic = fmt.Errorf("mnemonic phrase checksum doesn't " + 18 "match") 19 ) 20 21 // ErrUnknownMnenomicWord is returned when attempting to decipher and 22 // enciphered mnemonic, but a word encountered isn't a member of our word list. 23 type ErrUnknownMnenomicWord struct { 24 // Word is the unknown word in the mnemonic phrase. 25 Word string 26 27 // Index is the index (starting from zero) within the slice of strings 28 // that makes up the mnemonic that points to the incorrect word. 29 Index uint8 30 } 31 32 // Error returns a human readable string describing the error. 33 func (e ErrUnknownMnenomicWord) Error() string { 34 return fmt.Sprintf("word %v isn't a part of default word list "+ 35 "(index=%v)", e.Word, e.Index) 36 }