From e0c6839cd2ba02d509207740cd4e08a36eee5950 Mon Sep 17 00:00:00 2001 From: alyssa Date: Mon, 10 Mar 2025 15:16:32 +0000 Subject: [PATCH] fix(avatars): don't send image errors that aren't our fault to sentry --- crates/avatars/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/avatars/src/main.rs b/crates/avatars/src/main.rs index b880e326..3b621f52 100644 --- a/crates/avatars/src/main.rs +++ b/crates/avatars/src/main.rs @@ -24,7 +24,7 @@ use std::error::Error; use std::sync::Arc; use std::time::Duration; use thiserror::Error; -use tracing::{error, info}; +use tracing::{error, info, warn}; use uuid::Uuid; #[derive(Error, Debug)] @@ -262,7 +262,12 @@ impl IntoResponse for PKAvatarError { }; // print inner error if otherwise hidden - error!("error: {}", self.source().unwrap_or(&self)); + // `error!` calls go to sentry, so only use that if it's our error + if matches!(self, PKAvatarError::InternalError(_)) { + error!("error: {}", self.source().unwrap_or(&self)); + } else { + warn!("error: {}", self.source().unwrap_or(&self)); + } ( status_code,