Exception handling for writing AirQuality

This commit is contained in:
April 2022-10-17 21:12:07 -07:00
parent 1ff7731501
commit f7314f286f
No known key found for this signature in database
GPG Key ID: 17A9A017FAA4DE5E

View File

@ -53,6 +53,7 @@ def writeData():
# Check to see if we even have EPA ids, as some areas don't have air quality reports
if (useData):
try:
header = '<Data type="AirQuality">'
footer = "</Data>"
@ -88,6 +89,8 @@ def writeData():
os.remove("D:\\AirQuality.i2m")
os.remove("D:\\AirQuality.gz")
except Exception as e:
print("AirQuality failed to write, problably was expired and was sticking around in the IBM api.")
else:
print("Ignoring AirQuality data collection -- No working EPA Ids.")