From 72bfea8eed9209ebe15aca5068c923e927ac3ab1 Mon Sep 17 00:00:00 2001 From: pk5ls20 Date: Thu, 13 Feb 2025 22:30:14 +0800 Subject: [PATCH] fix: error in log output --- mania/src/core/business.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mania/src/core/business.rs b/mania/src/core/business.rs index a6299d9..354f56f 100644 --- a/mania/src/core/business.rs +++ b/mania/src/core/business.rs @@ -37,7 +37,7 @@ pub enum BusinessError { #[error("An mania error occurred: {0}")] GenericError(String), - #[error("An mania internal event error occurred: {0}")] + #[error("{0}")] InternalEventError(#[from] EventError), } @@ -254,7 +254,12 @@ impl BusinessHandle { tx.send(result).expect("receiver dropped"); } else if let Err(e) = &result { match e { - BusinessError::InternalEventError(inner_err @ EventError::UnsupportedEvent(_)) => { + BusinessError::InternalEventError(inner_err) + if matches!( + inner_err, + EventError::UnsupportedEvent(_) | EventError::InternalWarning(_) + ) => + { tracing::warn!("{}", inner_err); } _ => {