#[non_exhaustive]pub enum Error {
Codex32(Error),
WrongHrp {
got: String,
},
ThresholdNotZero {
got: u8,
},
ShareIndexNotSecret {
got: char,
},
TagInvalidAlphabet {
got: [u8; 4],
},
UnknownTag {
got: [u8; 4],
},
ReservedTagNotEmittedInV01 {
got: [u8; 4],
},
ReservedPrefixViolation {
got: u8,
},
UnexpectedStringLength {
got: usize,
allowed: &'static [usize],
},
PayloadLengthMismatch {
tag: [u8; 4],
expected: &'static [usize],
got: usize,
},
TooManyErrors {
bound: u8,
},
}Expand description
ms-codec error type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Codex32(Error)
Upstream codex32 parse / checksum failure (delegated from rust-codex32).
WrongHrp
HRP was not “ms” (SPEC §4 rule 2).
ThresholdNotZero
Threshold was not 0 (SPEC §4 rule 3).
Share-index was not ‘s’ — BIP-93 requires ‘s’ for threshold=0 (SPEC §4 rule 4).
TagInvalidAlphabet
Tag bytes were not in the codex32 alphabet (SPEC §4 rule 5).
UnknownTag
Tag was structurally valid but not in RESERVED_TAG_TABLE (SPEC §4 rule 6).
ReservedTagNotEmittedInV01
Tag was in RESERVED_TAG_TABLE but reserved-not-emitted in v0.1 (SPEC §4 rule 7, SPEC §3.5.1 encoder symmetry).
ReservedPrefixViolation
Reserved-prefix byte was not 0x00 (SPEC §4 rule 8).
UnexpectedStringLength
Total string length was outside the v0.1 emittable set (SPEC §4 rule 9).
Fields
PayloadLengthMismatch
Payload byte length did not match the tag’s spec (SPEC §3.5, §4 rule 10).
Fields
TooManyErrors
BCH error-correction (bch_decode) reported the input is uncorrectable
— the number of symbol errors exceeds the regular code’s t = 4
correction capacity (singleton bound d = 8). Surfaced by
crate::decode_with_correction when bch_decode::decode_regular_errors
returns None, or when a post-correction re-verification step fails
(catches pathological 5+-error patterns that fool the decoder into
producing a “consistent” but invalid locator). Added v0.2.0 per plan
§1 D29 + §2.B.2.
bound = 8 is the BCH(93,80,8) singleton bound. ms1 is single-chunk
only — no chunk_index field (cf. md-codec’s TooManyErrors which
carries chunk-set context).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()