refactor(errors): remove RedisErrorExt (#1389)

This commit is contained in:
Abhishek Marrivagu
2023-06-20 12:16:32 +05:30
committed by GitHub
parent 8fffc161ea
commit 5d515050cf

View File

@ -192,19 +192,3 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError>
}) })
} }
} }
pub trait RedisErrorExt {
#[track_caller]
fn to_redis_failed_response(self, key: &str) -> error_stack::Report<errors::StorageError>;
}
impl RedisErrorExt for error_stack::Report<errors::RedisError> {
fn to_redis_failed_response(self, key: &str) -> error_stack::Report<errors::StorageError> {
match self.current_context() {
errors::RedisError::NotFound => self.change_context(
errors::StorageError::ValueNotFound(format!("Data does not exist for key {key}",)),
),
_ => self.change_context(errors::StorageError::KVError),
}
}
}