From 284e60b2bee4acb571e0d173d2c780131084b3ca Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Thu, 12 Mar 2026 17:28:51 +0100 Subject: [PATCH] fix: Handle HTTP errors gracefully in wait-for-image action The action now catches and logs HTTP errors (502, 404, etc.) and network errors instead of crashing, allowing the polling loop to continue until the image appears or timeout is reached. Co-Authored-By: Claude Sonnet 4.5 --- release/wait-for-image/wait-for-images.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/release/wait-for-image/wait-for-images.py b/release/wait-for-image/wait-for-images.py index 51a4ed6..bc1821a 100755 --- a/release/wait-for-image/wait-for-images.py +++ b/release/wait-for-image/wait-for-images.py @@ -94,11 +94,14 @@ def check_image(image, token): if token: req.add_header('Authorization', f"Bearer {token}") - with urllib.request.urlopen(req) as resp: - body = resp.read().decode('utf-8') - - parsed = json.loads(body) - return parsed["tags"] and parsed["tags"][0]["name"] == image.tag + try: + with urllib.request.urlopen(req) as resp: + body = resp.read().decode('utf-8') + parsed = json.loads(body) + return parsed["tags"] and parsed["tags"][0]["name"] == image.tag + except Exception as e: + complain(f"Error checking '{image.name}:{image.tag}': {e}") + return False if __name__ == '__main__':