From ff1de48e173db18b2ed428b5521211dbc2ba70a5 Mon Sep 17 00:00:00 2001 From: T145 Date: Wed, 21 Feb 2024 13:05:53 -0500 Subject: [PATCH] Reverted prize error handling --- tools/update-prizes-list.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/update-prizes-list.py b/tools/update-prizes-list.py index 1e97ee7..66afd97 100644 --- a/tools/update-prizes-list.py +++ b/tools/update-prizes-list.py @@ -12,7 +12,7 @@ import asyncio import aiohttp import time -from aiohttp.client_exceptions import ClientResponseError +from aiohttp.client_exceptions import ClientConnectorError from itertools import chain @@ -32,13 +32,12 @@ async def _check_host(domain, session): return domain return None + except ClientConnectorError as e: + print("Unable to get {} due to {}: it will be recorded as dead.".format(domain, e.__class__)) + return f'-{domain}' except Exception as e: - if isinstance(e, ClientResponseError) and (e.status == 400 or e.status == 404): - print(f'Unable to get {domain}: it will be recorded as dead.') - return f'-{domain}' - else: - print(f'Got recorded offender {domain} with error {e.__class__}.') - return domain + print("Got recorded offender {} with error {}.".format(domain, e.__class__)) + return domain async def check_hosts(domains):