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

Return structured JSON error messages with 400 status code #32

Open
jwalgran opened this issue Aug 28, 2014 · 1 comment
Open

Return structured JSON error messages with 400 status code #32

jwalgran opened this issue Aug 28, 2014 · 1 comment

Comments

@jwalgran
Copy link
Contributor

Currently the service either returns a 500 status code when 400 is more appropriate.

Currently, the error returned is a plain string, which forces client code to resort to string matching in order to take different actions based on the specific failure.

Errors should, be structured and include a switch-able code and a detailed message to help developers in debugging.

{
  "error": "no_data_for_region",
  "message": "Species data not found for the NoWestYYY region"
}
@steventlamb
Copy link
Contributor

The 400 level code might be unattainable.

see related issue: #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants