diff --git a/src/errors.rs b/src/errors.rs index b5d1bee..9c300ff 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -59,6 +59,11 @@ error_chain! { display("The shares are incompatible with each other.") } + IncompatibleThresholds(sets: Vec>) { + description("The shares are incompatible with each other because they do not all have the same threshold.") + display("The shares are incompatible with each other because they do not all have the same threshold.") + } + MissingShares(provided: usize, required: u8) { description("The number of shares provided is insufficient to recover the secret.") display("{} shares are required to recover the secret, found only {}.", required, provided) diff --git a/src/share/validation.rs b/src/share/validation.rs index 143f5dd..a94b4dd 100644 --- a/src/share/validation.rs +++ b/src/share/validation.rs @@ -67,7 +67,7 @@ pub(crate) fn validate_shares(shares: Vec) -> Result<(u8, Vec) 1 => {} // All shares have the same roothash. _ => { bail! { - ErrorKind::IncompatibleSets( + ErrorKind::IncompatibleThresholds( k_compatibility_sets .values() .map(|x| x.to_owned())