Skip to content

Commit

Permalink
cleaner error logging when git command fails
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraschauer committed Aug 16, 2024
1 parent 19d16fe commit 5af0501
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prospector/git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()

Expand Down

0 comments on commit 5af0501

Please sign in to comment.