Skip to content

Commit

Permalink
Add redis error log.
Browse files Browse the repository at this point in the history
  • Loading branch information
gudaoxuri committed Jul 4, 2022
1 parent 5005fc7 commit f031eab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cache/cache_client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::collections::HashMap;

use futures_util::lock::{Mutex, MutexGuard};
use log::error;
use redis::aio::Connection;
use redis::{AsyncCommands, RedisError, RedisResult};
use url::Url;
Expand Down Expand Up @@ -220,6 +221,7 @@ impl TardisCacheClient {

impl From<RedisError> for TardisError {
fn from(error: RedisError) -> Self {
error!("[Tardis.CacheClient] [{}]{},", error.code().unwrap_or(""), error.detail().unwrap_or(""));
TardisError::Box(Box::new(error))
}
}

0 comments on commit f031eab

Please sign in to comment.