Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

api: improve status code reporting #183

Closed
fsouza opened this issue Feb 13, 2015 · 0 comments
Closed

api: improve status code reporting #183

fsouza opened this issue Feb 13, 2015 · 0 comments
Assignees

Comments

@fsouza
Copy link
Contributor

fsouza commented Feb 13, 2015

Currently, gandalf has poor status code reporting. Almost all errors are reported as 400 - bad request, we need to improve it so we have:

  • 400 - Bad request for validation errors (e.g.: missing or wrong parameters)
  • 404 - Not found for entities that doesn't exist (repository, user and key)
  • 409 - Conflict for entities that already exist (repository, user and key)
  • 500 - Internal server error for internal errors in the server (e.g: error communicating with the database or marshalling the output in JSON format)

What's interesting is that the fake server in the gandalftest package already behaves like that.

@fsouza fsouza self-assigned this Feb 13, 2015
fsouza pushed a commit that referenced this issue Feb 13, 2015
fsouza pushed a commit that referenced this issue Feb 13, 2015
This provides better semantics and prevents the API from importing mgo.

Related to #183.
fsouza pushed a commit that referenced this issue Feb 19, 2015
Returning a more explicit error for properly handling in the API.

Related to #183.
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
fsouza pushed a commit that referenced this issue Feb 19, 2015
@fsouza fsouza closed this as completed Feb 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant