Skip to content

Commit

Permalink
print url when timeout occurs (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield authored Nov 18, 2024
1 parent 1928ff1 commit 8774757
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion quartz_solar_forecast/weather/open_meteo.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ def get_hourly_weather(
"terrestrial_radiation",
]
url = self._build_url(latitude, longitude, start_date, end_date, variables)
response = requests.get(url)
try:
response = requests.get(url)
except requests.exceptions.Timeout:

raise TimeoutError(f"Request to OpenMeteo API timed out. URl - {url}")
data = response.json()["hourly"]

df = pd.DataFrame(data)
Expand Down

0 comments on commit 8774757

Please sign in to comment.