Skip to content

Commit e706aba

Browse files
Always raise PlotlyRequestError
1 parent bd801dd commit e706aba

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plotly/plotly/plotly.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1318,9 +1318,11 @@ def response_handler(cls, response):
13181318
errors = parsed_response.get('errors')
13191319
message = errors[-1]['message']
13201320
except:
1321-
raise requests_exception
1322-
1323-
raise exceptions.PlotlyError(message)
1321+
# otherwise raise a generic error
1322+
raise exceptions.PlotlyRequestError(requests_exception)
1323+
else:
1324+
requests_exception.message = message
1325+
raise exceptions.PlotlyRequestError(requests_exception)
13241326

13251327
if ('content-type' in response.headers and
13261328
'json' in response.headers['content-type'] and

0 commit comments

Comments
 (0)