1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5 #[error("secret is too long")]
6 SecretTooLong,
7
8 #[error("too many shares")]
9 TooManyShares,
10
11 #[error("interpolation failed")]
12 InterpolationFailure,
13
14 #[error("checksum failure")]
15 ChecksumFailure,
16
17 #[error("secret is too short")]
18 SecretTooShort,
19
20 #[error("secret is not of even length")]
21 SecretNotEvenLen,
22
23 #[error("invalid threshold")]
24 InvalidThreshold,
25
26 #[error("shares have unequal length")]
27 SharesUnequalLength,
28}
29
30pub type Result<T> = std::result::Result<T, Error>;