-
Notifications
You must be signed in to change notification settings - Fork 60
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
raise Oktakit::Error.from_response(response)
fails with TypeError
#59
Comments
arharovets
added a commit
to arharovets/oktakit
that referenced
this issue
Jun 13, 2022
This fixes [Shopify#59](Shopify#59) by modifying `Oktakit::Error.from_response()` method to accept and process client response and HTTP status. The reason behind these changes: ```ruby response, http_status = client.get_user('[email protected]') ``` This usage method is listed in the repo's README and works in most cases. However, it separates response from HTTP status. `response` is a `Sawyer::Resource` object and doesn't contain any data about the request (HTTP status, URL, method or headers). It only has a Hash with Okta error code, error summary, internal error link, error id and error causes, which causes a `TypeError` if we try to `raise Oktakit::Error.from_response(response) unless http_status == 200` in case the user is not found. With these changes implemented, we will gain the ability to process different response formats without causing errors on the client side.
arharovets
added a commit
to arharovets/oktakit
that referenced
this issue
Jun 14, 2022
This fixes Shopify#59 by modifying `Oktakit::Error.from_response()` method to accept and process client response and HTTP status. The reason behind these changes: ```ruby response, http_status = client.get_user('[email protected]') ``` This usage method is listed in the repo's README and works in most cases. However, it separates response from HTTP status. `response` is a `Sawyer::Resource` object and doesn't contain any data about the request (HTTP status, URL, method or headers). It only has a Hash with Okta error code, error summary, internal error link, error id and error causes, which causes a `TypeError` if we try to `raise Oktakit::Error.from_response(response) unless http_status == 200` in case the user is not found. With these changes implemented, we will gain the ability to process different response formats without causing errors on the client side.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
I've encountered an unexpected behavior when trying to raise
Oktakit::Error.from_response(response)
causingTypeError - exception object expected
withoktakit
version 0.3.1.Steps to reproduce
It looks like the structure of the response object for errors has changed (documentation link).
The text was updated successfully, but these errors were encountered: