Dont error if vaccination data isnt available

This commit is contained in:
Luke Robles 2021-01-24 19:51:13 -08:00
parent 227ee02ee0
commit f9e99af2ae
No known key found for this signature in database
GPG Key ID: D70F99D67F488AF9

View File

@ -80,7 +80,10 @@ def get_vaccination_data(location):
cols = [ele.text.strip() for ele in cols]
data.append([ele for ele in cols if ele]) # Get rid of empty values
state_name, num_vaccinated, population, percent_vaccinated = list(filter(lambda x: x[0] == location, data))[0]
try:
state_name, num_vaccinated, population, percent_vaccinated = list(filter(lambda x: x[0] == location, data))[0]
except Exception:
return "Not available for %s" % location
return percent_vaccinated
def parse_message(message):