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

Requesting a branch and getting a 200 response with invalid JSON returns null #607

Closed
alexanderrtaylor opened this issue Nov 13, 2019 · 0 comments
Labels

Comments

@alexanderrtaylor
Copy link
Contributor

alexanderrtaylor commented Nov 13, 2019

Issue:
When requesting data about a single branch via the github-api, if it gets a 404 or nothing back from the branch it will return a null value for the branch rather than throwing an error.

Steps to reproduce: (did this while mocking a github response)

  1. Request a single branch by name
  2. Fake a returned json for a 200(branch does not exist)
  3. Observe that the github-api returns instead a null value

Expected result:
I would normally expect the github API to return a GHFileNotFound error rather than a null value since that is what happens if you make the same request for a tag or PR

alexanderrtaylor pushed a commit to alexanderrtaylor/github-api that referenced this issue Nov 13, 2019
Added a test so that we can prove when this issue is fixed
@bitwiseman bitwiseman added the bug label Nov 14, 2019
@alexanderrtaylor alexanderrtaylor changed the title When requesting a single branch and getting a 404 response it will return "null" When requesting a single branch and getting a 200 response it will return "null" Nov 14, 2019
@alexanderrtaylor alexanderrtaylor mentioned this issue Nov 15, 2019
4 tasks
@bitwiseman bitwiseman changed the title When requesting a single branch and getting a 200 response it will return "null" Requesting a branch and getting a 200 response with invalid JSON returns null Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants