From 9a39bf3f09192a9dd3e3514fe288c70931873ffe Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 14 Dec 2022 16:02:37 +0100 Subject: [PATCH] Be consistent when logging errors --- crates/storage/src/oauth2/access_token.rs | 2 +- crates/storage/src/oauth2/refresh_token.rs | 4 ++-- crates/storage/src/upstream_oauth2/link.rs | 2 +- crates/storage/src/user/mod.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/storage/src/oauth2/access_token.rs b/crates/storage/src/oauth2/access_token.rs index aac95c57..be983142 100644 --- a/crates/storage/src/oauth2/access_token.rs +++ b/crates/storage/src/oauth2/access_token.rs @@ -30,7 +30,7 @@ use crate::{Clock, DatabaseError, DatabaseInconsistencyError}; user.id = %session.browser_session.user.id, access_token.id, ), - err(Debug), + err, )] pub async fn add_access_token( executor: impl PgExecutor<'_>, diff --git a/crates/storage/src/oauth2/refresh_token.rs b/crates/storage/src/oauth2/refresh_token.rs index df9bfadc..74e111c9 100644 --- a/crates/storage/src/oauth2/refresh_token.rs +++ b/crates/storage/src/oauth2/refresh_token.rs @@ -33,7 +33,7 @@ use crate::{Clock, DatabaseError, DatabaseInconsistencyError}; client.id = %session.client.id, refresh_token.id, ), - err(Debug), + err, )] pub async fn add_refresh_token( executor: impl PgExecutor<'_>, @@ -259,7 +259,7 @@ pub async fn lookup_active_refresh_token( fields( %refresh_token.id, ), - err(Debug), + err, )] pub async fn consume_refresh_token( executor: impl PgExecutor<'_>, diff --git a/crates/storage/src/upstream_oauth2/link.rs b/crates/storage/src/upstream_oauth2/link.rs index 520ed3f0..931b2b7d 100644 --- a/crates/storage/src/upstream_oauth2/link.rs +++ b/crates/storage/src/upstream_oauth2/link.rs @@ -198,7 +198,7 @@ pub async fn associate_link_to_user( #[tracing::instrument( skip_all, fields(%user.id, %user.username), - err(Display) + err )] pub async fn get_paginated_user_links( executor: impl PgExecutor<'_>, diff --git a/crates/storage/src/user/mod.rs b/crates/storage/src/user/mod.rs index c687a5c8..1b8c2c61 100644 --- a/crates/storage/src/user/mod.rs +++ b/crates/storage/src/user/mod.rs @@ -695,7 +695,7 @@ pub async fn add_user_email( %user_email.id, %user_email.email, ), - err(Display), + err, )] pub async fn set_user_email_as_primary( executor: impl PgExecutor<'_>,