ReadonlynameAlways "ShamirError"; the cross-copy identity ShamirError.isShamirError checks.
ReadonlycodeThe discriminant; equals details.code.
ReadonlydetailsThe structured payload, discriminated by code.
StaticisType guard for a ShamirError, including one from another copy of this package.
StaticsecretThe secret is longer than MAX_SECRET_LENGTH.
StatictooshareCount is above MAX_SHARE_COUNT.
StaticinterpolationRust compatibility variant; current split and recovery paths do not produce it.
StaticchecksumThe recovered digest does not match: wrong, missing, or corrupted shares.
StaticsecretThe secret is shorter than MIN_SECRET_LENGTH.
StaticsecretThe secret has an odd number of bytes.
Staticinvalidthreshold is below 1 or above shareCount (or, on recovery, no shares).
StaticsharesNot every share has the same length.
Staticinvalidparameter is outside its domain: an integer parameter that is not a
usize (neither a safe non-negative integer number nor a bigint in
[0, 2^64 - 1]), or an argument of the wrong type. value is what was
received; the message renders it exactly.
Thrown for invalid split parameters, malformed share sets, a failed recovery checksum, and (JS-only) an argument outside its domain: a
threshold,shareCountor shareindexthat is not ausize, or an argument of the wrong type. Branch oncode; messages are the reference's strings.Instances come from the static factories only.
Example