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

How to manage errors #5

Closed
niconoe opened this issue Nov 3, 2018 · 3 comments
Closed

How to manage errors #5

niconoe opened this issue Nov 3, 2018 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@niconoe
Copy link
Collaborator

niconoe commented Nov 3, 2018

For example, currently client code can receive something like {'error': 'Cette observation n’existe plus.'}. as a return value from update_observation()...

So the client code should look for an 'error' key in each of the results (and I'm not sure the API is really consistent in that). So it seems it would be more pythonic and nicer to raise an exception (a very specific if possible, or general one like Error 500 otherwise) each time it's not Status=200.

@niconoe niconoe added the question Further information is requested label Nov 3, 2018
@niconoe niconoe self-assigned this Nov 3, 2018
@niconoe
Copy link
Collaborator Author

niconoe commented Nov 5, 2018

Just updated update_observation() so it raises a requests.HTTPError if status != 200.

If this approach is choosen:

  • Update all other functions so they work the same
  • Test this
  • Document this

@peterdesmet
Copy link
Contributor

Seems reasonable to provide as nice an error we can, given what the API consistently returns.

@JWCook
Copy link
Member

JWCook commented Sep 1, 2020

I am going to go ahead and close this issue, and will make additional issues for more specific error-handling features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants