Skip to content

Commit 8c69a59

Browse files
committed
fix: add generic exception handling for subprocess in git_utils
X-AI-Prompt: add catch-all exception handler to redact credentials X-AI-Tool: kiro-cli
1 parent 3878100 commit 8c69a59

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎sagemaker-core/src/sagemaker/core/git_utils.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ def _run_clone_command(repo_url, dest_dir):
371371
output=e.output,
372372
stderr=e.stderr,
373373
) from None
374+
except Exception as e:
375+
safe_url = _redact_credentials_from_url(repo_url)
376+
raise type(e)(str(e).replace(repo_url, safe_url)) from None
374377
elif repo_url.startswith("git@") or repo_url.startswith("ssh://"):
375378
try:
376379
with tempfile.TemporaryDirectory() as tmp_dir:

0 commit comments

Comments
 (0)