Skip to content

Commit

Permalink
Call raise_for_status on hg.mozilla.org json-automationrelevance resp…
Browse files Browse the repository at this point in the history
…onse (#419)

Makes more sense to get an http exception rather than a json decode error.
  • Loading branch information
jcristau authored Feb 1, 2024
1 parent a7be8da commit 85c360e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/taskgraph/files_changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def _get_changed_files_json_automationrelevance(head_repository_url, head_rev):

def get_automationrelevance():
response = requests.get(url, timeout=30)
response.raise_for_status()
return response.json()

contents = retry(get_automationrelevance, attempts=10, sleeptime=10)
Expand Down
3 changes: 3 additions & 0 deletions test/test_files_changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def json(self):
) as f:
return json.load(f)

def raise_for_status(self):
pass


class TestGetChangedFiles(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 85c360e

Please sign in to comment.