Skip to content

Commit

Permalink
Gracefully catch first run error.
Browse files Browse the repository at this point in the history
  • Loading branch information
uajqq committed Jan 15, 2025
1 parent 3baa510 commit 139c74e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/user/belchertown.py
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,12 @@ def aeris_icon(data):
# Catch errors caused by ASCII characters in Python2
file.write(forecast_file_result)
loginf("New forecast file downloaded to %s" % forecast_file)
except FileNotFoundError as error:
loginf(
"Belchertown JSON folder does not exist. Usually this "
"is an error that only occurs on the first run. If it "
"is appearing repeatedly, check file permissions."
)
except IOError as e:
raise Warning(
"Error writing forecast info to %s. Reason: %s"
Expand Down Expand Up @@ -1532,7 +1538,7 @@ def aeris_icon(data):
visibility = "N/A"
visibility_unit = ""
cloud_cover = ""
logerr("Aeris/XWeather connection error: %s" % error)
logerr("Aeris/Xweather error: %s" % error)

# ==============================================================================
# Earthquake Data
Expand Down

0 comments on commit 139c74e

Please sign in to comment.