handlers::views: don't rely on #[instrument(err)] to capture errors

This commit is contained in:
Quentin Gliech
2025-04-17 16:24:27 +02:00
parent 38b3dc6ce6
commit 28026e8001
9 changed files with 9 additions and 14 deletions

View File

@@ -25,7 +25,7 @@ pub struct Params {
action: Option<mas_router::AccountAction>,
}
#[tracing::instrument(name = "handlers.views.app.get", skip_all, err)]
#[tracing::instrument(name = "handlers.views.app.get", skip_all)]
pub async fn get(
PreferredLanguage(locale): PreferredLanguage,
State(templates): State<Templates>,
@@ -74,7 +74,7 @@ pub async fn get(
/// Like `get`, but allow anonymous access.
/// Used for a subset of the account management paths.
/// Needed for e.g. account recovery.
#[tracing::instrument(name = "handlers.views.app.get_anonymous", skip_all, err)]
#[tracing::instrument(name = "handlers.views.app.get_anonymous", skip_all)]
pub async fn get_anonymous(
PreferredLanguage(locale): PreferredLanguage,
State(templates): State<Templates>,

View File

@@ -19,7 +19,7 @@ use crate::{
session::{SessionOrFallback, load_session_or_fallback},
};
#[tracing::instrument(name = "handlers.views.index.get", skip_all, err)]
#[tracing::instrument(name = "handlers.views.index.get", skip_all)]
pub async fn get(
mut rng: BoxRng,
clock: BoxClock,

View File

@@ -61,7 +61,7 @@ impl ToFormState for LoginForm {
type Field = LoginFormField;
}
#[tracing::instrument(name = "handlers.views.login.get", skip_all, err)]
#[tracing::instrument(name = "handlers.views.login.get", skip_all)]
pub(crate) async fn get(
mut rng: BoxRng,
clock: BoxClock,
@@ -127,7 +127,7 @@ pub(crate) async fn get(
.await
}
#[tracing::instrument(name = "handlers.views.login.post", skip_all, err)]
#[tracing::instrument(name = "handlers.views.login.post", skip_all)]
pub(crate) async fn post(
mut rng: BoxRng,
clock: BoxClock,

View File

@@ -18,7 +18,7 @@ use mas_storage::{BoxClock, BoxRepository, user::BrowserSessionRepository};
use crate::BoundActivityTracker;
#[tracing::instrument(name = "handlers.views.logout.post", skip_all, err)]
#[tracing::instrument(name = "handlers.views.logout.post", skip_all)]
pub(crate) async fn post(
clock: BoxClock,
mut repo: BoxRepository,

View File

@@ -20,7 +20,7 @@ mod cookie;
pub(crate) mod password;
pub(crate) mod steps;
#[tracing::instrument(name = "handlers.views.register.get", skip_all, err)]
#[tracing::instrument(name = "handlers.views.register.get", skip_all)]
pub(crate) async fn get(
mut rng: BoxRng,
clock: BoxClock,

View File

@@ -66,7 +66,7 @@ pub struct QueryParams {
action: OptionalPostAuthAction,
}
#[tracing::instrument(name = "handlers.views.password_register.get", skip_all, err)]
#[tracing::instrument(name = "handlers.views.password_register.get", skip_all)]
pub(crate) async fn get(
mut rng: BoxRng,
clock: BoxClock,
@@ -118,7 +118,7 @@ pub(crate) async fn get(
Ok((cookie_jar, Html(content)).into_response())
}
#[tracing::instrument(name = "handlers.views.password_register.post", skip_all, err)]
#[tracing::instrument(name = "handlers.views.password_register.post", skip_all)]
#[allow(clippy::too_many_lines, clippy::too_many_arguments)]
pub(crate) async fn post(
mut rng: BoxRng,

View File

@@ -49,7 +49,6 @@ impl ToFormState for DisplayNameForm {
name = "handlers.views.register.steps.display_name.get",
fields(user_registration.id = %id),
skip_all,
err,
)]
pub(crate) async fn get(
mut rng: BoxRng,
@@ -100,7 +99,6 @@ pub(crate) async fn get(
name = "handlers.views.register.steps.display_name.post",
fields(user_registration.id = %id),
skip_all,
err,
)]
pub(crate) async fn post(
mut rng: BoxRng,

View File

@@ -42,7 +42,6 @@ static PASSWORD_REGISTER_COUNTER: LazyLock<Counter<u64>> = LazyLock::new(|| {
name = "handlers.views.register.steps.finish.get",
fields(user_registration.id = %id),
skip_all,
err,
)]
pub(crate) async fn get(
mut rng: BoxRng,

View File

@@ -37,7 +37,6 @@ impl ToFormState for CodeForm {
name = "handlers.views.register.steps.verify_email.get",
fields(user_registration.id = %id),
skip_all,
err,
)]
pub(crate) async fn get(
mut rng: BoxRng,
@@ -104,7 +103,6 @@ pub(crate) async fn get(
name = "handlers.views.account_email_verify.post",
fields(user_email.id = %id),
skip_all,
err,
)]
pub(crate) async fn post(
clock: BoxClock,