Defensive coding

This commit is contained in:
Ian Renton
2025-11-29 15:50:55 +00:00
parent 0fa8b44c9c
commit 3da8c80ad6
2 changed files with 12 additions and 5 deletions

View File

@@ -455,6 +455,11 @@ class LookupHelper:
# QRZ had no info for the call, that's OK. Cache a None so we don't try to look this up again
self.QRZ_CALLSIGN_DATA_CACHE.add(call, None, expire=604800) # 1 week in seconds
return None
except (Exception):
# General exception like a timeout when communicating with QRZ. Return None this time, but don't cache
# that, so we can try again next time.
logging.error("Exception when looking up QRZ data")
return None
else:
return None