From 5d515050cf77705e3bf8c4b83f81ee51a8bff052 Mon Sep 17 00:00:00 2001 From: Abhishek Marrivagu <68317979+Abhicodes-crypto@users.noreply.github.com> Date: Tue, 20 Jun 2023 12:16:32 +0530 Subject: [PATCH] refactor(errors): remove RedisErrorExt (#1389) --- crates/router/src/core/errors/utils.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/crates/router/src/core/errors/utils.rs b/crates/router/src/core/errors/utils.rs index 7c2b48cfe8..235b83f0b2 100644 --- a/crates/router/src/core/errors/utils.rs +++ b/crates/router/src/core/errors/utils.rs @@ -192,19 +192,3 @@ impl ConnectorErrorExt for error_stack::Result }) } } - -pub trait RedisErrorExt { - #[track_caller] - fn to_redis_failed_response(self, key: &str) -> error_stack::Report; -} - -impl RedisErrorExt for error_stack::Report { - fn to_redis_failed_response(self, key: &str) -> error_stack::Report { - 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), - } - } -}