#[derive(Debug, thiserror::Error, PartialEq)]
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}")]
InvalidWindowSizeSeconds(String),
#[error("invalid rate group size: {0}")]
InvalidRateGroupSizeMs(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 duration: {0}")]
InvalidSuppressionFactorCacheMs(String),
}