Skip to content

Commit

Permalink
chore: reduce unnecessary GitHub pull backtrace log (#3544)
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
zwpaper authored Dec 11, 2024
1 parent b3a2b42 commit 675c654
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)
}

// 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));
None
}
}
Expand Down

0 comments on commit 675c654

Please sign in to comment.