Skip to content

Commit 396833b

Browse files
committed
handle another API error
1 parent 0b5ba09 commit 396833b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pvlib/iotools/ecmwf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ def get_era5(latitude, longitude, start, end, variables, api_key,
127127
slug = "processes/reanalysis-era5-single-levels-timeseries/execution"
128128
response = requests.post(url + slug, json=params, headers=headers)
129129
submission_response = response.json()
130+
if not response.ok:
131+
raise Exception(response.json()) # likely need to accept license
130132
job_id = submission_response['jobID']
131133

132134
# Step 2: poll until the data request is ready

0 commit comments

Comments
 (0)