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

When client encounters an unknown status code, response body is lost #426

Open
taylor-sutton opened this issue Apr 26, 2022 · 0 comments
Open
Labels
enhancement go-client relating to the generated Go client
Milestone

Comments

@taylor-sutton
Copy link
Contributor

For example:

return nil, "", &models.InternalError{Message: fmt.Sprintf("Unknown status code %v", resp.StatusCode)}

This makes adding a new response status code to an existing endpoint on the server side particularly painful. If using an old client on a new server, it's reasonable to have some incompatibilities, as adding a new response code is, in some ways, a breaking change, but in practice we at Clever sometimes convert classes of 5xx into 4xx and would like to make this a bit smoother. Today, converting a 5xx into a 4xx in our API on the server-side and using an old client means the client doesn't understand the new status code, so it spits out an Internal Error (that's reasonable) BUT if the client is going to do so, it at least should not lose the response body.

@taylor-sutton taylor-sutton added this to the v9.0 milestone Apr 26, 2022
@taylor-sutton taylor-sutton added enhancement go-client relating to the generated Go client labels Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement go-client relating to the generated Go client
Projects
None yet
Development

No branches or pull requests

1 participant