#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum ConfigError {
#[error("ERR Option '{name}' is read-only and cannot be set at runtime.")]
ReadOnly { name: String },
#[error("ERR Invalid value for '{name}': expected an integer.")]
InvalidInteger { name: String },
#[error("ERR Value for '{name}' is out of range ({min}..{max}).")]
OutOfRange { name: String, min: i64, max: i64 },
#[error("ERR Invalid value for '{name}': expected 'yes' or 'no'.")]
InvalidBool { name: String },
#[error("ERR Invalid value for '{name}': '{value}'.")]
InvalidEnum { name: String, value: String },
#[error("ERR Option '{name}' is not runtime-adjustable.")]
NotRuntimeAdjustable { name: String },
#[error(
"ERR 'aof-commit-freq' cannot be set to 0 at runtime; per-operation auto-commit is fixed at startup."
)]
CommitFreqZero,
#[error(
"ERR 'aof-commit-freq' cannot be changed at runtime because the server started with per-operation auto-commit (0)."
)]
CommitFreqAutoCommitStart,
#[error(
"The raw configuration value {raw} is out of bounds or not a defined member of the declared enum."
)]
EnumOutOfRange { raw: i64 },
}