Skip to content

Commit

Permalink
Fail on submission failure
Browse files Browse the repository at this point in the history
  • Loading branch information
j6k4m8 committed Jan 29, 2023
1 parent 37be67b commit c97f874
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import os
import json
import sys
import requests
import glob

Expand Down Expand Up @@ -163,7 +164,12 @@ def submit_all_open_assignments():
}

# Upload the assignment
print(submit_tarball(assignment_headers, tarball_path).json())
response = submit_tarball(assignment_headers, tarball_path)
response.raise_for_status()
if "error" in response.json():
print(response.json()["error"])
sys.exit(1)
print(response.json())


def main():
Expand Down

0 comments on commit c97f874

Please sign in to comment.