Browse Source

don't raise error when nothing was found

ta 2 years ago
parent
commit
e64cca8c3f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      searx/engines/wttr.py

+ 5 - 0
searx/engines/wttr.py

@@ -82,12 +82,17 @@ def request(query, params):
 
     params["url"] = url.format(query=quote(query), lang=params["language"])
 
+    params["raise_for_httperror"] = False
+
     return params
 
 
 def response(resp):
     results = []
 
+    if resp.status_code == 404:
+        return []
+
     result = loads(resp.text)
 
     current = result["current_condition"][0]