From a224b1f1b523f8e18754e3aa6493b5a5239a257c Mon Sep 17 00:00:00 2001 From: scc Date: Thu, 23 May 2024 02:04:04 +0800 Subject: [PATCH] fix: Improve error handling in commit_full_text_message 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. --- src/git_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git_utils.py b/src/git_utils.py index df67e3b..01c6b93 100644 --- a/src/git_utils.py +++ b/src/git_utils.py @@ -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)