8000 feat: add details to TwilioRestException by ashish-s · Pull Request #517 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content

feat: add details to TwilioRestException #517

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 4 commits into from
Apr 27, 2020
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
simply details assignment
  • Loading branch information
ashish-s committed Apr 27, 2020
commit b55b47665c623cf81303385b4e330c023bb17311
4 changes: 1 addition & 3 deletions twilio/base/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ def exception(cls, method, uri, response, message):
# noinspection PyBroadException
try:
error_payload = json.loads(response.text)
details = {}
if 'message' in error_payload:
message = '{}: {}'.format(message, error_payload['message'])
if 'details' in error_payload:
details = error_payload['details']
details = error_payload.get('details')
code = error_payload.get('code', response.status_code)
return TwilioRestException(response.status_code, uri, message, code, method, details)
except Exception:
Expand Down
0