Skip to content

Commit

Permalink
fix: Improve error handling in commit_full_text_message
Browse files Browse the repository at this point in the history
Handle exceptions more clearly by renaming the variable 'e' to
'exception_detail'. Update the error message to include the specific
details of the exception for better debugging.
  • Loading branch information
25077667 committed May 22, 2024
1 parent 770cee8 commit a224b1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def commit_full_text_message(repo_path: str, message: str) -> str:
committer = Actor(author, author_email)

return repo.index.commit(message=message, committer=committer).hexsha
except Exception as e: # pylint: disable=broad-except
logger.error("Failed to commit the message. Details: %s", e)
except Exception as exception_detail: # pylint: disable=broad-except
logger.error("Failed to commit the message. Details: %s", exception_detail)
sys.exit(1)


Expand Down

0 comments on commit a224b1f

Please sign in to comment.