From c9c94380dc557a75dca2776771f3cb36dfa6f496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Mon, 3 Feb 2025 10:58:46 +0100 Subject: [PATCH] update-schutzfile-images: don't catch HTTPError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- schutzbot/update-schutzfile-images | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/schutzbot/update-schutzfile-images b/schutzbot/update-schutzfile-images index 214beca8..2c4a758a 100755 --- a/schutzbot/update-schutzfile-images +++ b/schutzbot/update-schutzfile-images @@ -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"]