Fix 500 on unknown location

This commit is contained in:
Ceda EI 2020-08-08 15:39:04 +05:30
parent 6ac1457f3a
commit 723fb81d28
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ def main(location, geocoder, cache_db, kind, unit):
"Main function that returns the weather based on parameters"
try:
coordinates = get_coordinates(location, geocoder, cache_db)
except KeyError:
except (IndexError, KeyError):
return "Location Not found"
weather = get_weather(coordinates)
text = weather_to_text(weather, kind, unit, coordinates[2])