#[derive(Debug, thiserror::Error, PartialEq)]
#[non_exhaustive]
pub enum TrypemaError {
#[cfg(any(feature = "redis-tokio", feature = "redis-smol"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "redis-tokio", feature = "redis-smol"))))]
#[error("redis error: {0}")]
RedisError(#[from] redis::RedisError),
#[error("invalid rate limit: {0}")]
InvalidRateLimit(String),
#[error("invalid window size: {0}")]
InvalidWindowSize(String),
#[error("invalid bucket size: {0}")]
InvalidBucketSize(String),
#[error("invalid hard limit factor: {0}")]
InvalidHardLimitFactor(String),
#[cfg(any(feature = "redis-tokio", feature = "redis-smol"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "redis-tokio", feature = "redis-smol"))))]
#[error("invalid Redis key: {0}")]
InvalidRedisKey(String),
#[cfg(any(feature = "redis-tokio", feature = "redis-smol"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "redis-tokio", feature = "redis-smol"))))]
#[error("unexpected Redis script result for {operation} (key={key}): {result}")]
UnexpectedRedisScriptResult {
operation: &'static str,
key: String,
result: String,
},
#[error("custom error: {0}")]
CustomError(String),
#[error("invalid suppression-factor cache period: {0}")]
InvalidSuppressionFactorCachePeriod(String),
#[error("invalid sync interval: {0}")]
InvalidSyncInterval(String),
#[error("invalid cleanup configuration: {0}")]
InvalidCleanupConfiguration(String),
}