mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-06 17:37:47 +08:00
16 lines
419 B
Rust
16 lines
419 B
Rust
pub use aether_data_contracts::DataLayerError;
|
|||
|
|
|
||
|
|
pub(crate) fn redis_error(error: impl std::fmt::Display) -> DataLayerError {
|
||
|
|
DataLayerError::redis(error)
|
||
|
|
}
|
||
|
|
|
||
|
|
pub(crate) trait RedisResultExt<T> {
|
||
|
|
fn map_redis_err(self) -> Result<T, DataLayerError>;
|
||
|
|
}
|
||
|
|
|
||
|
|
impl<T> RedisResultExt<T> for Result<T, redis::RedisError> {
|
||
|
|
fn map_redis_err(self) -> Result<T, DataLayerError> {
|
||
|
|
self.map_err(redis_error)
|
||
|
|
}
|
||
|
|
}
|