diff --git a/src/key.rs b/src/key.rs index 1fe01fe8..d81b3687 100644 --- a/src/key.rs +++ b/src/key.rs @@ -464,7 +464,7 @@ where /// let hm: HMGetResult<'_, &str, RedisString> = ctx /// .open_key(&key_name) /// .hash_get_multi(fields)? - /// .ok_or(RedisError::Str("ERR key not found"))?; + /// .ok_or(RedisError::Str("key not found"))?; /// let response: Vec = hm.into_iter().map(|(_, v)| v.into()).collect(); /// Ok(RedisValue::Array(response)) /// } @@ -482,7 +482,7 @@ where /// let hm: HMGetResult<'_, &str, RedisString> = ctx /// .open_key(&key_name) /// .hash_get_multi(fields)? - /// .ok_or(RedisError::Str("ERR key not found"))?; + /// .ok_or(RedisError::Str("key not found"))?; /// let response: Vec = hm.into_iter().map(|(_, v)| RedisValue::BulkRedisString(v)).collect(); /// Ok(RedisValue::Array(response)) /// } diff --git a/src/raw.rs b/src/raw.rs index 0a70118e..d91d8455 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -370,7 +370,7 @@ where match res { Status::Ok => Ok(()), - Status::Err => Err(RedisError::Str("ERR key is not a hash value")), + Status::Err => Err(RedisError::Str("key is not a hash value")), } } diff --git a/src/rediserror.rs b/src/rediserror.rs index e7645a0b..0d821d5a 100644 --- a/src/rediserror.rs +++ b/src/rediserror.rs @@ -13,18 +13,18 @@ pub enum RedisError { impl RedisError { #[must_use] pub const fn nonexistent_key() -> Self { - Self::Str("ERR could not perform this operation on a key that doesn't exist") + Self::Str("could not perform this operation on a key that doesn't exist") } #[must_use] pub const fn short_read() -> Self { - Self::Str("ERR short read or OOM loading DB") + Self::Str("short read or OOM loading DB") } } impl From for RedisError { fn from(e: T) -> Self { - Self::String(format!("ERR {e}")) + Self::String(e.to_string()) } } @@ -45,6 +45,6 @@ impl fmt::Display for RedisError { Self::String(s) => s.as_str(), }; - write!(f, "{d}") + write!(f, "ERR {d}") } }