Skip to content

Conversation

@pitbulk
Copy link
Contributor

@pitbulk pitbulk commented Jul 7, 2018

See #4

@pitbulk
Copy link
Contributor Author

pitbulk commented Jul 7, 2018

@richet what do you think? Is there a more elegant way to manage this?

TODO: Add documentation

@after_cursor = after_cursor(json)
else
results
@error = response.code.to_s
Copy link
Contributor

Choose a reason for hiding this comment

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

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/console
client = 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 

@pitbulk
Copy link
Contributor Author

pitbulk commented Jul 11, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants