Improve error reporting

This commit is contained in:
Ian Renton
2026-07-25 08:53:55 +01:00
parent 66010dc682
commit c397009ada
16 changed files with 227 additions and 157 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ class GIROIonosonde(SolarConditionsProvider):
to_str = to_time.strftime("%Y.%m.%d+%H:%M:%S")
url = f"{LGDC_URL}?ursiCode={ursi}&charName=foF2,MUFD,fmin&DMUF=3000&fromDate={from_str}&toDate={to_str}"
http_response = requests.get(url, headers=HTTP_HEADERS, timeout=(5, 15))
if http_response.status_code != 200:
if not http_response.ok:
logging.warning(f"HTTP {http_response.status_code} when calling Giro ionosonde API.")
return None, None, None
return self._parse_all(http_response.text)
@@ -40,7 +40,7 @@ class HTTPSolarConditionsProvider(SolarConditionsProvider):
logging.debug("Polling " + self.name + " solar conditions API...")
http_response = requests.get(self._url, headers=HTTP_HEADERS, timeout=(5, 30))
# Check response code was good
if http_response.status_code == 200:
if http_response.ok:
new_data = self._http_response_to_solar_conditions(http_response)
self.update_data(new_data)
+1 -1
View File
@@ -45,7 +45,7 @@ class KC2GProp(SolarConditionsProvider):
try:
logging.debug("Polling KC2G ionosonde data...")
http_response = requests.get(KC2G_URL, headers=HTTP_HEADERS, timeout=(5, 30))
if http_response.status_code != 200:
if not http_response.ok:
logging.warning(f"HTTP {http_response.status_code} when calling KG2G ionosonde API.")
return