Skip to content

[2.0.0] Unify API #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 9, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Always raise PlotlyRequestError
  • Loading branch information
alexandresobolevski authored and theengineear committed Jan 5, 2017
commit f425a4cc12d06a8be32861aedcad542d0f308fee
8 changes: 5 additions & 3 deletions plotly/plotly/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,9 +1318,11 @@ def response_handler(cls, response):
errors = parsed_response.get('errors')
message = errors[-1]['message']
except:
raise requests_exception

raise exceptions.PlotlyError(message)
# otherwise raise a generic error
raise exceptions.PlotlyRequestError(requests_exception)
else:
requests_exception.message = message
raise exceptions.PlotlyRequestError(requests_exception)

if ('content-type' in response.headers and
'json' in response.headers['content-type'] and
Expand Down