mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Improve error reporting
This commit is contained in:
+10
-2
@@ -153,6 +153,8 @@ class LookupHelper:
|
||||
logging.warning(f"HTTP {response.status_code} when downloading Country-files.com cty.plist.")
|
||||
return False
|
||||
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when downloading Clublog cty.xml.")
|
||||
except Exception as e:
|
||||
logging.error("Exception when downloading Clublog cty.xml", e)
|
||||
return False
|
||||
@@ -175,6 +177,8 @@ class LookupHelper:
|
||||
logging.warning(f"HTTP {response.status_code} when downloading dxcc.json.")
|
||||
return False
|
||||
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when downloading dxcc.json.")
|
||||
except Exception as e:
|
||||
logging.error("Exception when downloading dxcc.json", e)
|
||||
return False
|
||||
@@ -519,8 +523,10 @@ class LookupHelper:
|
||||
|
||||
except (KeyError, ValueError):
|
||||
continue
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when looking up callsign %s using QRZ", lookup_call)
|
||||
except Exception:
|
||||
logging.error("Exception when looking up QRZ data")
|
||||
logging.error("Exception when looking up callsign %s using QRZ", lookup_call)
|
||||
return None
|
||||
|
||||
# Not found in QRZ; cache None so we don't keep retrying
|
||||
@@ -578,8 +584,10 @@ class LookupHelper:
|
||||
|
||||
except (KeyError, ValueError):
|
||||
continue
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when looking up callsign %s using HamQTH", lookup_call)
|
||||
except Exception:
|
||||
logging.error("Exception when looking up HamQTH data")
|
||||
logging.error("Exception when looking up callsign %s using HamQTH", lookup_call)
|
||||
return None
|
||||
|
||||
# Not found in HamQTH; cache None so we don't keep retrying
|
||||
|
||||
+3
-1
@@ -259,8 +259,10 @@ def populate_sig_ref_info(sig_ref):
|
||||
else:
|
||||
logging.warning("DME database did not contain data for ref %s", ref_id)
|
||||
|
||||
except ConnectionError:
|
||||
logging.warning("Connection error when looking up sig_ref info for " + sig + " ref " + ref_id)
|
||||
except Exception:
|
||||
logging.warning("Exception when looking up sig_ref info for " + sig + " ref " + ref_id, exc_info=True)
|
||||
logging.error("Exception when looking up sig_ref info for " + sig + " ref " + ref_id, exc_info=True)
|
||||
return sig_ref
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user