Skip to content

Commit 1128e00

Browse files
committed
return error if get_grid reques is not ok
1 parent 7887873 commit 1128e00

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plotly/plotly/plotly.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,15 @@ def get_grid(grid_url, raw=False):
14841484

14851485
# make request to grab the grid id (fid)
14861486
r_meta = requests.get(meta_get_url, headers=headers)
1487+
1488+
# check if request is ok
1489+
if not r_meta.ok:
1490+
raise exceptions.PlotlyError(
1491+
"Whoops, you got a 404 response. Your grid url {} may be "
1492+
"pointing to a plot rather than a grid. If it is a grid, make "
1493+
"sure your grid is 'public' and not 'private' or 'secret'."
1494+
)
1495+
14871496
json_res_meta = json.loads(r_meta.text)
14881497
retrieved_grid_id = json_res_meta['fid']
14891498

0 commit comments

Comments
 (0)