Skip to content

Commit

Permalink
log exceptions during whois lookups instead of crashing. see #66
Browse files Browse the repository at this point in the history
  • Loading branch information
Svedrin committed Oct 6, 2024
1 parent 590fd1a commit 2419451
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/meshping.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os.path
import math
import sys
import logging

from uuid import uuid4
from time import time
Expand Down Expand Up @@ -124,6 +125,8 @@ async def run_whois(self):
except IPDefinedError:
# RFC1918, RFC6598 or something else
continue
except Exception as err:
logging.warning("Could not query whois for IP %s: %s", hop["address"], err)

self.whois_cache = whois_cache
await trio.sleep(next_run - time())
Expand Down

0 comments on commit 2419451

Please sign in to comment.