Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d13972

Browse files
committed
raise error if the body contains an non-empty error key
1 parent ff43855 commit 3d13972

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plotly/plotly/plotly.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,9 @@ def _send_to_plotly(figure, **plot_options):
14351435
r.raise_for_status()
14361436
r = json.loads(r.text)
14371437

1438+
if 'error' in r and r['error'] != '':
1439+
raise exceptions.PlotlyError(r['error'])
1440+
14381441
# Check if the url needs a secret key
14391442
if (plot_options['sharing'] == 'secret' and
14401443
'share_key=' not in r['url']):

0 commit comments

Comments
 (0)