Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit b31d2f0

Browse files
committed
chore: use specific exceptions instead of generic
Signed-off-by: Zack Koppert <zkoppert@github.com>
1 parent 255dfef commit b31d2f0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

open_contrib_pr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def clone_repository(gh_actor, token, endpoint, repo):
154154
repo_name = repo["name"]
155155
try:
156156
os.system(f"git clone https://{gh_actor}:{token}@{endpoint}/{repo_full_name}")
157-
except Exception as e: # pylint: disable=broad-exception-caught
157+
except OSError as e:
158158
print(f"Failed to clone repository: {e}")
159159
return None
160160
return repo_name

test_open_contrib_pr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_clone_repository_failure(self, mock_system):
6565
"""
6666
Test the clone_repository function when the clone fails.
6767
"""
68-
mock_system.side_effect = Exception("Clone failed") # Simulate clone failure
68+
mock_system.side_effect = OSError("Clone failed") # Simulate clone failure
6969

7070
result = clone_repository(
7171
gh_actor="test_actor",

0 commit comments

Comments
 (0)