Skip to content
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

fix: fallback to empty array for users with no repos #26

Merged
merged 1 commit into from Jun 25, 2019

Conversation

lubien
Copy link
Contributor

@lubien lubien commented Jun 17, 2019

GitHub throws HTTP error 422 when you search for repos from an user with no repos.

This approach detects it and return an empty array to properly be handled later.

You can test it going here.

{
  "message": "Validation Failed",
  "errors": [
    {
      "message": "The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.",
      "resource": "Search",
      "field": "q",
      "code": "invalid"
    }
  ],
  "documentation_url": "https://developer.github.com/v3/search/"
}

GitHub return HTTP error 422 when you search
for repos from an user with no repos.

This approach detects it and return an empty array
to properly be handled later.
@egoist egoist changed the title Fallback to empty array for user with no repos fix: fallback to empty array for users with no repos Jun 25, 2019
@egoist egoist merged commit a33fc51 into saberland:master Jun 25, 2019
@lubien lubien deleted the no-repos-user branch June 25, 2019 05:16
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.

None yet

2 participants