From 195377284d5eec3624724a8e6faad4b4fd6e4fee Mon Sep 17 00:00:00 2001 From: Mason10198 <31994327+Mason10198@users.noreply.github.com> Date: Tue, 25 Jul 2023 18:24:07 -0500 Subject: [PATCH] TimeType error catching --- SkywarnPlus.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SkywarnPlus.py b/SkywarnPlus.py index c635b85..b2ca2b8 100644 --- a/SkywarnPlus.py +++ b/SkywarnPlus.py @@ -375,10 +375,16 @@ def get_alerts(countyCodes): LOGGER.debug("getAlerts: Using effective time for alerting") time_type_start = "effective" time_type_end = "expires" - else: + elif timetype_mode == "onset": LOGGER.debug("getAlerts: Using onset time for alerting") time_type_start = "onset" time_type_end = "ends" + else: + LOGGER.error( + "getAlerts: Invalid TimeType specified in config.yaml. Using onset time instead." + ) + time_type_start = "onset" + time_type_end = "ends" for countyCode in countyCodes: url = "https://api.weather.gov/alerts/active?zone={}".format(countyCode)