From bbf0d6835f4fe056cfd4d7b958f46cd8a411663a Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sat, 27 Feb 2021 18:27:27 +0100 Subject: [PATCH] Generate exception page (commented out) --- lib/wttr_srv.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/wttr_srv.py b/lib/wttr_srv.py index 0d9eeef..4ebc397 100644 --- a/lib/wttr_srv.py +++ b/lib/wttr_srv.py @@ -375,6 +375,8 @@ def wttr(location, request): if not response: parsed_query = parse_request(location, request, query) response = _response(parsed_query, query) + #if not response or (isinstance(response, str) and not response.strip()): + # return RuntimeError("Empty answer") if parsed_query["location"] == NOT_FOUND_LOCATION: http_code = 404