From 723fb81d28014f26280956c5181244169fa5faa1 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sat, 8 Aug 2020 15:39:04 +0530 Subject: [PATCH] Fix 500 on unknown location --- server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.py b/server.py index 3aff822..fd90b22 100644 --- a/server.py +++ b/server.py @@ -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])