From f68c53348838c08ff2102854d22f69a574cbfe85 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 23 Oct 2025 20:08:42 -0700 Subject: [PATCH] errorLoggin --- modules/locationdata.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/locationdata.py b/modules/locationdata.py index 8d4b8d4..edeb079 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -258,8 +258,8 @@ def get_NOAAweather(lat=0, lon=0, unit=0): if not weather_data.ok: logger.warning("Location:Error fetching weather data from NOAA for location") return ERROR_FETCHING_DATA - except (requests.exceptions.RequestException): - logger.warning("Location:Error fetching weather data from NOAA for location") + except Exception: + logger.warning(f"Location:Error fetching weather data error: {Exception}") return ERROR_FETCHING_DATA # get the forecast URL from the JSON response weather_json = weather_data.json() @@ -269,8 +269,8 @@ def get_NOAAweather(lat=0, lon=0, unit=0): if not forecast_data.ok: logger.warning("Location:Error fetching weather forecast from NOAA") return ERROR_FETCHING_DATA - except (requests.exceptions.RequestException): - logger.warning("Location:Error fetching weather forecast from NOAA") + except Exception: + logger.warning(f"Location:Error fetching weather data error: {Exception}") return ERROR_FETCHING_DATA # from periods, get the detailedForecast from number of days in NOAAforecastDuration @@ -409,8 +409,8 @@ def getWeatherAlertsNOAA(lat=0, lon=0, useDefaultLatLon=False): if not alert_data.ok: logger.warning("Location:Error fetching weather alerts from NOAA") return ERROR_FETCHING_DATA - except (requests.exceptions.RequestException): - logger.warning("Location:Error fetching weather alerts from NOAA") + except Exception: + logger.warning(f"Location:Error fetching weather data error: {Exception}") return ERROR_FETCHING_DATA alerts = "" @@ -483,8 +483,8 @@ def getActiveWeatherAlertsDetailNOAA(lat=0, lon=0): if not alert_data.ok: logger.warning("Location:Error fetching weather alerts from NOAA") return ERROR_FETCHING_DATA - except (requests.exceptions.RequestException): - logger.warning("Location:Error fetching weather alerts from NOAA") + except Exception: + logger.warning(f"Location:Error fetching weather data error: {Exception}") return ERROR_FETCHING_DATA alerts = ""