welds-connections 0.4.23

An async ORM for (postgres, mssql, mysql, sqlite)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[cfg(feature = "tracing")]
use tracing;

/// Emits an event when an error is returned from the client, if the "tracing" feature
/// is enabled and a corresponding tracing-subscriber is registered, otherwise no-op
pub fn db_error<T, E>(result: Result<T, E>) -> Result<T, E>
where
    E: std::fmt::Display,
{
    #[cfg(feature = "tracing")]
    if let Err(e) = result {
        tracing::warn!("Database Error; {}", e);
        return Err(e);
    }
    result
}