Skip to content

Commit 061487b

Browse files
committed
fix: do not capture auth errors as sentry messages
1 parent dc1506c commit 061487b

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

rust/server/src/vss_service.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,14 @@ async fn handle_request<
314314
auth_response.user_token
315315
},
316316
Err(e) => {
317-
sentry::capture_message(
318-
&format!("Authentication failure: {}", e),
319-
sentry::Level::Warning,
320-
);
317+
// Skip Sentry for AuthError: it just means the user has an invalid or
318+
// expired token, which spams our alerts.
319+
if !matches!(e, VssError::AuthError(_)) {
320+
sentry::capture_message(
321+
&format!("Authentication failure: {}", e),
322+
sentry::Level::Warning,
323+
);
324+
}
321325
tracing::warn!(error = %e, "Authentication failure");
322326
return Ok(build_error_response(e));
323327
},

0 commit comments

Comments
 (0)