1#[cfg(feature = "std")]
2use thiserror::Error;
3
4use hmac::crypto_mac::InvalidKeyLength;
5
6#[cfg_attr(feature = "std", derive(Error))]
7#[derive(Debug)]
8pub enum Error {
9 #[cfg_attr(feature = "std", error("invalid digits size, must be at least 6"))]
10 InvalidDigitsSize,
11 #[cfg_attr(feature = "std", error(transparent))]
12 InvalidKeySize(#[cfg_attr(feature = "std", from)] InvalidKeyLength),
13 #[cfg_attr(feature = "std", error("system time was before the epoch"))]
14 InvalidSystemTime,
15 #[cfg_attr(feature = "std", error("time step cannot be 0"))]
16 InvalidStep,
17 #[cfg_attr(feature = "std", error("timestamp must be greater than or equal to the epoch"))]
18 InvalidTimeOrEpoch,
19}