Fix #4. Detect HTTP RESPONSES different than 200 on Cursor objects#19
Open
Fix #4. Detect HTTP RESPONSES different than 200 on Cursor objects#19
Conversation
Contributor
Author
|
@richet what do you think? Is there a more elegant way to manage this? TODO: Add documentation |
richet
reviewed
Jul 10, 2018
| @after_cursor = after_cursor(json) | ||
| else | ||
| results | ||
| @error = response.code.to_s |
Contributor
There was a problem hiding this comment.
This doesnt actually work. If you run this branch in the console using some Auth Only credentials you would expect it to produce a 401 error but in reality it just returns nil.
e.g. Run the sdk console
> bin/consoleclient = OneLogin::Api::Client.new(
client_id: 'xxx',
client_secret:'xxx',
region: 'us'
)
users = client.get_users
# returns the cursor but no error yet as the users not fetched until each is called
users = client.get_users.each{|u|u.id}
# returns nil and since the error is applied to the cursor and not the client it is not visible
Contributor
Author
|
The master branch return no error on client too. My patch at provides error on the cursor object but I dont know how to propagate the error to the client. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #4