Skip to content

Commit

Permalink
Reverted prize error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
T145 committed Feb 21, 2024
1 parent ddd36f8 commit ff1de48
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tools/update-prizes-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):
Expand Down

0 comments on commit ff1de48

Please sign in to comment.