Skip to content

Conversation

@rohanjadvani
Copy link
Contributor

Implement __str__ for a human-readable format as exceptions come up.

@rohanjadvani rohanjadvani requested a review from a team as a code owner February 23, 2021 17:38
@linear
Copy link

linear bot commented Feb 23, 2021

SDK-52 Raise exception with error message for errors on /sso/token

  • Implement toString
  • Show request id

Make this better:

  File "/app/app/oauth/routes.py", line 98, in oauth_callback
    profile = workos_client.sso.get_profile(code)
  File "/usr/local/lib/python3.7/site-packages/workos/sso.py", line 122, in get_profile
    TOKEN_PATH, method=REQUEST_METHOD_POST, params=params
  File "/usr/local/lib/python3.7/site-packages/workos/utils/request.py", line 74, in request
    raise BadRequestException(response)
workos.exceptions.BadRequestException: <Response [400]>

Copy link
Contributor

@jthodge jthodge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This'll be a much better improvement to the stack trace we currently surface :chef-kiss:

@rohanjadvani rohanjadvani merged commit 2cecd7b into master Feb 23, 2021
@rohanjadvani rohanjadvani deleted the feature/sdk-52-raise-exception-with-error-message-for branch February 23, 2021 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants