fix(error): use Debug formatting in AppError logs for full error chain visibility
This commit is contained in:
parent
c10134c32e
commit
358dff152d
@ -13,19 +13,19 @@ pub enum AppError {
|
|||||||
|
|
||||||
#[cfg(feature = "server")]
|
#[cfg(feature = "server")]
|
||||||
impl AppError {
|
impl AppError {
|
||||||
pub fn db_conn(e: impl std::fmt::Display) -> Self {
|
pub fn db_conn(e: impl std::fmt::Debug) -> Self {
|
||||||
tracing::error!("DB connection failed: {e}");
|
tracing::error!("DB connection failed: {e:?}");
|
||||||
AppError::DbConn(e.to_string())
|
AppError::DbConn(format!("{e:?}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn query(e: impl std::fmt::Display) -> Self {
|
pub fn query(e: impl std::fmt::Debug) -> Self {
|
||||||
tracing::error!("Query failed: {e}");
|
tracing::error!("Query failed: {e:?}");
|
||||||
AppError::Query(e.to_string())
|
AppError::Query(format!("{e:?}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tx(e: impl std::fmt::Display) -> Self {
|
pub fn tx(e: impl std::fmt::Debug) -> Self {
|
||||||
tracing::error!("Transaction failed: {e}");
|
tracing::error!("Transaction failed: {e:?}");
|
||||||
AppError::Transaction(e.to_string())
|
AppError::Transaction(format!("{e:?}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user