Skip to content

Commit

Permalink
run_command: catch all exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nunofachada committed Apr 15, 2024
1 parent cca7ba2 commit 76068e6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions egrader/plugins/repo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Repository plug-ins."""

import shlex
import sys
from datetime import date, datetime
from pathlib import Path
from subprocess import TimeoutExpired, run
Expand Down Expand Up @@ -116,6 +117,14 @@ def assess_run_command(
except (TimeoutExpired, FileNotFoundError):
return 0

except Exception as ex:
print(
f"Unexpected error '{ex}' running command '{command}' in "
+ "folder '{repo_path}'",
file=sys.stderr,
)
return 0

if expect_exit_code != r.returncode:
return 0

Expand Down

0 comments on commit 76068e6

Please sign in to comment.