diff --git a/bin/proxy.py b/bin/proxy.py index 96d22a3..d38244f 100644 --- a/bin/proxy.py +++ b/bin/proxy.py @@ -63,7 +63,6 @@ def load_translations(): return translations TRANSLATIONS = load_translations() - def _find_srv_for_query(path, query): # pylint: disable=unused-argument return 'http://api.worldweatheronline.com' @@ -206,8 +205,8 @@ def proxy(path): if response: headers = {} headers['Content-Type'] = response.headers['content-type'] + _save_content_and_headers(path, query_string, response.content, headers) content = add_translations(response.content, lang) - _save_content_and_headers(path, query_string, content, headers) else: content = "{}" diff --git a/lib/wttr_srv.py b/lib/wttr_srv.py index e389e6d..a55c934 100644 --- a/lib/wttr_srv.py +++ b/lib/wttr_srv.py @@ -301,14 +301,14 @@ def wttr(location, request): return _wrap_response(output, html_output) - except RuntimeError as exception: - if 'Malformed response' in str(exception) \ - or 'API key has reached calls per day allowed limit' in str(exception): + except Exception as exception: + # if 'Malformed response' in str(exception) \ + # or 'API key has reached calls per day allowed limit' in str(exception): if html_output: return _wrap_response(MALFORMED_RESPONSE_HTML_PAGE, html_output) return _wrap_response(get_message('CAPACITY_LIMIT_REACHED', lang).encode('utf-8'), html_output) - logging.error("Exception has occured", exc_info=1) - return "ERROR" + # logging.error("Exception has occured", exc_info=1) + # return "ERROR" if __name__ == "__main__": import doctest