update-schutzfile-images: don't catch HTTPError

Catching the exception just to print it and exit with non-zero exit
return code. Let's not catch it at all.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-02-03 10:58:46 +01:00 committed by Achilleas Koutsou
parent d8f353b3b7
commit c9c94380dc

View file

@ -14,12 +14,9 @@ def images_main_commit_id():
if token:
# this API request doesn't necessarily require a token, but let's use it if we have one
req.add_header("Authorization", f"Bearer {token}")
try:
with urllib.request.urlopen(req, timeout=30) as resp:
body = resp.read()
except urllib.error.HTTPError as http_error:
print(http_error)
sys.exit(1)
with urllib.request.urlopen(req, timeout=30) as resp:
body = resp.read()
data = json.loads(body)
return data["sha"]