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

ObjectNotFound does not get risen, when the request returns a 404 #25

Open
DebVortex opened this issue Mar 9, 2015 · 2 comments · May be fixed by #55
Open

ObjectNotFound does not get risen, when the request returns a 404 #25

DebVortex opened this issue Mar 9, 2015 · 2 comments · May be fixed by #55
Assignees
Milestone

Comments

@DebVortex
Copy link
Contributor

Currently, durga only raises a ObjectNotFound exception, when the API returns a valid but empty response, when the get function of the collection is called. An API may also return a 404, which causes durga to try to decode non existing JSON.

@DebVortex DebVortex added the bug label Mar 9, 2015
@keimlink keimlink changed the title ObjectNotFound does not get rissen, when the request returns a 404 ObjectNotFound does not get risen, when the request returns a 404 Mar 9, 2015
@keimlink
Copy link
Member

keimlink commented Mar 9, 2015

Thanks for the bug report @DebVortex! We have to decide how to handle this problem.

  1. Raise an ObjectNotFound exception
  2. Same as 1. but add the response object to the exception as an attribute
  3. Raising an HTTPError using the raise_for_status() method provided by requests, which will contain the request and response objects

@DebVortex
Copy link
Contributor Author

I would vote for option 3.

@keimlink keimlink added this to the 0.2.0 milestone Jun 2, 2015
@keimlink keimlink self-assigned this Jun 2, 2015
@keimlink keimlink linked a pull request Jun 2, 2015 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants