From 5af05010b21e05f0280b736cf70b2aa1370a921a Mon Sep 17 00:00:00 2001 From: I748376 Date: Fri, 9 Aug 2024 08:42:05 +0000 Subject: [PATCH] cleaner error logging when git command fails --- prospector/git/git.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prospector/git/git.py b/prospector/git/git.py index ef317fc37..adf6eb853 100644 --- a/prospector/git/git.py +++ b/prospector/git/git.py @@ -311,6 +311,8 @@ def parse_git_output(self, raw: List[str]) -> Dict[str, RawCommit]: return commits def find_commits_for_twin_lookups(self, commit_id): + """Finds all relevant commits around the given commit wihin a time + window of 10 days. Search is narrowed if too many commits are found.""" # Using both author date and commit date we should cover all cases. try: commit_timestamp_a = self.get_timestamp(commit_id, "a") @@ -329,8 +331,8 @@ def find_commits_for_twin_lookups(self, commit_id): return dict() - except Exception: - logger.error("Git command failed, cannot get commits", exc_info=True) + except Exception as e: + logger.error(f"Git command failed, cannot get commits: {e}") return dict()