|
|
|
@ -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
|
|
|
|
|