Skip to content

Commit 4b53e78

Browse files
committed
supported 5/9 of chris' suggested error msgs
1 parent 7887873 commit 4b53e78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plotly/plotly/plotly.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,15 +1586,15 @@ def create_animations(figure, filename=None, sharing='public', auto_open=True):
15861586

15871587
api_url = _api_v2.api_url('plots')
15881588
r = requests.post(api_url, auth=auth, headers=headers, json=json)
1589-
r.raise_for_status()
15901589

15911590
try:
15921591
parsed_response = r.json()
15931592
except:
15941593
parsed_response = r.content
15951594

1596-
if 'error' in r and r['error'] != '':
1597-
raise exceptions.PlotlyError(r['error'])
1595+
# raise error message
1596+
if r.ok is False:
1597+
raise exceptions.PlotlyError(parsed_response['errors'][-1]['message'])
15981598

15991599
if sharing == 'secret':
16001600
web_url = (parsed_response['file']['web_url'][:-1] +

0 commit comments

Comments
 (0)