In a new, untested action file, I mistyped the uses: value with a repo name that did not exist.
During the HTTP call for highest version, a 404 is returns, but not handled.
|
response = await make_request(client, url) |
|
tags.update({t["name"]: t["commit"]["sha"] for t in response.json()}) |
Leading to this exception:
| Traceback (most recent call last):
| File "<env>/python3.14/site-packages/gha_update/_core.py", line 145, in get_highest_version
| tags.update({t["name"]: t["commit"]["sha"] for t in response.json()})
| ~^^^^^^^^
| TypeError: string indices must be integers, not 'str'
Would it make sense to handle the 404 explicitly in make_request() like the 403, or implement a raise_for_status call more broadly to capture any issues and handle the the explicit ones and let the remaining re-raise with a cleaner message?
In a new, untested action file, I mistyped the
uses:value with a repo name that did not exist.During the HTTP call for highest version, a 404 is returns, but not handled.
gha-update/src/gha_update/_core.py
Lines 143 to 144 in dee97f7
Leading to this exception:
| Traceback (most recent call last): | File "<env>/python3.14/site-packages/gha_update/_core.py", line 145, in get_highest_version | tags.update({t["name"]: t["commit"]["sha"] for t in response.json()}) | ~^^^^^^^^ | TypeError: string indices must be integers, not 'str'Would it make sense to handle the 404 explicitly in
make_request()like the 403, or implement araise_for_statuscall more broadly to capture any issues and handle the the explicit ones and let the remaining re-raise with a cleaner message?