Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Conversation

@guyzmo
Copy link

@guyzmo guyzmo commented Apr 2, 2016

Instead of a generic 'service not found' error for any request with HTTP
error code between 400 and 500, added checks for 400, 401, 403 and for
all the others in that range, give a generic 'Request error' message.

Also, changed the second part of the error checking from a simple string
into a dict with more details on the error (with message as string, reason
as the given json object, and code as the HTTP code returned, to make it
easier to act accordingly to the type of error returned by the API.

I updated the tests with this change implemented as well.

guyzmo added 2 commits April 2, 2016 15:21
Instead of a generic 'service not found' error for any request with HTTP
error code between 400 and 500, added checks for 400, 401, 403 and for
all the others in that range, give a generic 'Request error' message.

Also, changed the second part of the error checking from a simple string
into a dict with more details on the error (with message as string, reason
as the given json object, and code as the HTTP code returned, to make it
easier to act accordingly to the type of error returned by the API.
- added KeyError, as when it returns an error the repositories key is missing
  and the TypeError used does not catch that issue.
- added test assertions against other error fields
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant