From 7d21927e32f9b58cf8c41861585aa66c39a2d50b Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Wed, 11 Dec 2024 19:16:48 +0800 Subject: [PATCH] chore: reduce unnecessary GitHub pull backtrace log Signed-off-by: Wei Zhang --- .../service/background_job/third_party_integration/error.rs | 5 +++++ .../service/background_job/third_party_integration/pulls.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ee/tabby-webserver/src/service/background_job/third_party_integration/error.rs b/ee/tabby-webserver/src/service/background_job/third_party_integration/error.rs index dd8d993a48dc..b695a8cc9eb5 100644 --- a/ee/tabby-webserver/src/service/background_job/third_party_integration/error.rs +++ b/ee/tabby-webserver/src/service/background_job/third_party_integration/error.rs @@ -6,6 +6,11 @@ pub fn octocrab_error_message(err: octocrab::Error) -> String { format!("GitHub error: {} {}", source.status_code, source.message) } + // no need to print the Json error backtrace + octocrab::Error::Json { source, .. } => { + format!("Json error: {}", source) + } + // the other errors have impl Display or Debug _ => err.to_string(), } diff --git a/ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs b/ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs index 08302b46ba09..37a66a62fe90 100644 --- a/ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs +++ b/ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs @@ -58,7 +58,7 @@ pub async fn list_github_pulls( profile.email } Err(e) => { - debug!("Failed to fetch user profile for {}: {}", author, e); + debug!("Failed to fetch user profile for {}: {}", author, octocrab_error_message(e)); None } }