This commit is contained in:
parent
0294ad3a66
commit
db2f98e63a
1 changed files with 3 additions and 2 deletions
|
@ -36,8 +36,9 @@ def index(request):
|
||||||
logger.info(f"[weather_success] city={city} duration={duration:.3f}s temp={weather_data['temperature']}")
|
logger.info(f"[weather_success] city={city} duration={duration:.3f}s temp={weather_data['temperature']}")
|
||||||
|
|
||||||
except requests.HTTPError as http_err:
|
except requests.HTTPError as http_err:
|
||||||
error = f"HTTP error: {http_err}"
|
error = f"Weather in {city} can't be found"
|
||||||
logger.warning(f"[weather_http_error] city={city} error={http_err}")
|
logger.error(f"[weather_http_error] city={city} error={http_err}")
|
||||||
|
weather_data = None
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error = "Something went wrong."
|
error = "Something went wrong."
|
||||||
|
|
Loading…
Reference in a new issue