mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Structure changes to match other projects and minor logging improvements
This commit is contained in:
+11
-1
@@ -11,7 +11,7 @@ from pyhamtools import LookupLib, Callinfo, callinfo
|
||||
from pyhamtools.exceptions import APIKeyMissingError
|
||||
from pyhamtools.frequency import freq_to_band
|
||||
from pyhamtools.locator import latlong_to_locator
|
||||
from requests.exceptions import ConnectionError
|
||||
from requests.exceptions import ConnectionError, ReadTimeout
|
||||
from requests_cache import CachedSession
|
||||
|
||||
from core.cache_utils import SEMI_STATIC_URL_DATA_CACHE
|
||||
@@ -156,6 +156,8 @@ class LookupHelper:
|
||||
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when downloading Clublog cty.xml.")
|
||||
except ReadTimeout:
|
||||
logging.warning(f"Read timeout when downloading Clublog cty.xml.")
|
||||
except Exception as e:
|
||||
logging.error("Exception when downloading Clublog cty.xml", e)
|
||||
return False
|
||||
@@ -180,6 +182,8 @@ class LookupHelper:
|
||||
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when downloading dxcc.json.")
|
||||
except ReadTimeout:
|
||||
logging.warning(f"Read timeout when downloading dxcc.json.")
|
||||
except Exception as e:
|
||||
logging.error("Exception when downloading dxcc.json", e)
|
||||
return False
|
||||
@@ -537,6 +541,9 @@ class LookupHelper:
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when looking up callsign %s using QRZ", lookup_call)
|
||||
continue
|
||||
except ReadTimeout:
|
||||
logging.warning(f"Read timeout when looking up callsign %s using QRZ.", lookup_call)
|
||||
continue
|
||||
except Exception:
|
||||
logging.error("Exception when looking up callsign %s using QRZ", lookup_call, exc_info=True)
|
||||
continue
|
||||
@@ -601,6 +608,9 @@ class LookupHelper:
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when looking up callsign %s using HamQTH", lookup_call)
|
||||
continue
|
||||
except ReadTimeout:
|
||||
logging.warning(f"Read timeout when looking up callsign %s using HamQTH", lookup_call)
|
||||
continue
|
||||
except Exception:
|
||||
logging.error("Exception when looking up callsign %s using HamQTH", lookup_call, exc_info=True)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user