errorLoggin

This commit is contained in:
SpudGunMan
2025-10-23 20:08:42 -07:00
parent 6e47d71028
commit f68c533488
+8 -8
View File
@@ -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 = ""