Skip to content

Commit

Permalink
fix: Improve error message on broken URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Jul 24, 2023
1 parent 3735eb5 commit 00e8b91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lacuscore/lacuscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,11 @@ async def _capture(self, uuid: str, priority: int):
try:
ips_info = socket.getaddrinfo(splitted_url.hostname, None, proto=socket.IPPROTO_TCP)
except socket.gaierror:
logger.debug(f'Unable to resolve "{splitted_url.hostname}" - Original URL: "{url}".')
result = {'error': f'Unable to resolve "{splitted_url.hostname}" - Original URL: "{url}".'}
logger.debug(f'Unable to resolve "{splitted_url.hostname}" - Full URL: "{url}".')
result = {'error': f'Unable to resolve "{splitted_url.hostname}" - Full URL: "{url}".'}
raise RetryCapture
except Exception as e:
result = {'error': f'Issue with hostname resolution ({splitted_url.hostname}): {e}. Original URL: "{url}".'}
result = {'error': f'Issue with hostname resolution ({splitted_url.hostname}): {e}. Full URL: "{url}".'}
raise CaptureError
for info in ips_info:
if not ipaddress.ip_address(info[-1][0]).is_global:
Expand Down

0 comments on commit 00e8b91

Please sign in to comment.