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 = ""