fix of the weather page
All checks were successful
ci / build (push) Successful in 34s

This commit is contained in:
evdo 2025-04-01 10:50:03 +02:00
parent 0294ad3a66
commit db2f98e63a

View file

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