-
Notifications
You must be signed in to change notification settings - Fork 66
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 502
for gateway validation errors
#2111
Conversation
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.
Question: Why do we need to change the response status code to 502?
For validation errors, the appropriate status code is generally 400 Bad Request, as it indicates an issue with the request sent by the client. However, since this is an internal validation error (an issue occurring within our service logic rather than due to a client error), 500 Internal Server Error is more suitable. This code reflects that the error was caused by the server’s internal processing rather than by the client’s input.
This error happened because the way
I don't have a strong opinion regarding this, but I think distinguishing 500/generic errors from 502 errors caused by server-side validation can be beneficial 🙂 |
As per discussion: this allows us to distinguish datasource validation. Whilst we want to reassess/improve our error handling, this is a simple adjustment to distinguish the aforemented for the time being. Note: this includes the changes of #2174 to save exposing a |
Summary
When validating the response of a service, we return a
500
. This is a vague response.This changes server validation-related error codes to
502
.Changes