Improve error handling to spare the server log from user's malformed requests and stop trying to parse data from providers if the HTTP status was not 200

This commit is contained in:
Ian Renton
2026-07-25 08:17:17 +01:00
parent 34e3933d5d
commit 2fc9658571
26 changed files with 169 additions and 128 deletions
@@ -80,10 +80,6 @@ class NOAA3dayForecast(HTTPSolarConditionsProvider):
return result if result else None
def _http_response_to_solar_conditions(self, http_response):
if http_response.status_code != 200:
logging.warning("NOAA K-index forecast API returned HTTP " + str(http_response.status_code))
return None
lines = http_response.text.splitlines()
# Find the "NOAA Kp index breakdown" section header