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 Error Messages #86

Open
everclear opened this issue Mar 31, 2015 · 1 comment
Open

Return Error Messages #86

everclear opened this issue Mar 31, 2015 · 1 comment

Comments

@everclear
Copy link

This is a non issue really, I'm just curious! What's the design reason for spitting out the 'kind' of error? I don't get the benefit of return it to the end user (and exposing internals).

{
  "description": "Invalid id given",
  "error": "validator.Errors"
}

vs

{
  "error": "Invalid id given"
}
@willfaught
Copy link

Not sure about validator errors, but in general normal errors like 404s and 400s will look like:

{"error": "bad_request", "description": "foo"}

This could be useful if, say, you're logging responses; the error string indicates what kind of error it is. I imagine validator errors are even more useful, as a simple 400 status code or "bad_request" error value tells you nothing about what specific kind of problem there was. I guess you have to ensure validator errors don't contain sensitive info, or if you can't, then don't use them (I don't have experience with validators, myself).

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

No branches or pull requests

2 participants