fix(gateway): remove superflous redis error handling code that actually created more errors

This commit is contained in:
alyssa 2025-03-08 11:58:54 +00:00
parent 5fa9266d8d
commit ec49ead783
4 changed files with 2 additions and 23 deletions

View file

@ -9,7 +9,6 @@ use sentry_tracing::event_from_event;
pub mod db;
pub mod state;
pub mod util;
pub mod _config;
pub use crate::_config::CONFIG as config;

View file

@ -1 +0,0 @@
pub mod redis;

View file

@ -1,15 +0,0 @@
use fred::error::RedisError;
pub trait RedisErrorExt<T> {
fn to_option_or_error(self) -> Result<Option<T>, RedisError>;
}
impl<T> RedisErrorExt<T> for Result<T, RedisError> {
fn to_option_or_error(self) -> Result<Option<T>, RedisError> {
match self {
Ok(v) => Ok(Some(v)),
Err(error) if error.is_not_found() => Ok(None),
Err(error) => Err(error),
}
}
}