mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(avatars): don't send image errors that aren't our fault to sentry
This commit is contained in:
parent
71e8cf960c
commit
e0c6839cd2
1 changed files with 7 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue