Skip to content

Commit

Permalink
chore: reduce unnecessary GitHub pull backtrace log
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
zwpaper committed Dec 11, 2024
1 parent b3a2b42 commit 7d21927
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 11 in ee/tabby-webserver/src/service/background_job/third_party_integration/error.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-webserver/src/service/background_job/third_party_integration/error.rs#L10-L11

Added lines #L10 - L11 were not covered by tests
}

// the other errors have impl Display or Debug
_ => err.to_string(),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Check warning on line 61 in ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs#L61

Added line #L61 was not covered by tests
None
}
}
Expand Down

0 comments on commit 7d21927

Please sign in to comment.