-
Notifications
You must be signed in to change notification settings - Fork 37
RFC: Standardize API error messages #48
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
RFC: Standardize API error messages #48
Conversation
Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io> Co-authored-by: Taylor Silva <tsilva@pivotal.io>
Signed-off-by: Taylor Silva <tsilva@pivotal.io>
Not sure why it's PR concourse#53, when the previous one was concourse#48...perhaps because of discussions? Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io>
chenbh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this qualifies as a RFC under then new guidelines, it feels like this falls under the Small features which only impact a narrow use case and affect users in an obvious way. category. wdyt?
| { | ||
| "type": "MachineReadable", | ||
| "message": "human readable" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the jsonAPI idea of enclosing this inside a top level errors field, makes it more obvious it's an error if I forgot to look at the status code
{
"errors": [
{
"type": ...
}
]
}| If further arbitrary details are required any number of extra keys can be added | ||
| to the JSON object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of generating an UUID on 5xx errors? It could make errors a lot easier to track down in the logs
|
|
||
| # Proposal | ||
|
|
||
| When the Concourse API returns an error (4xx and 5xx status codes) it should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we differentiate between different levels of verbosity for 4xx vs 5xx codes? 4xx codes usually indicate user error and misuse of the API, in which case a helpful error message would be appreciated. 5xx codes indicate something has gone wrong on the server side and there's nothing the user can really do with the error message.
|
I agree. Going to close this. |
Rendered
Signed-off-by: Aidan Oldershaw aoldershaw@pivotal.io
Co-authored-by: Taylor Silva tsilva@pivotal.io