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

Translate gRPC FailedPrecondition as HTTP PreconditionFailed #657

Merged
merged 1 commit into from
May 23, 2018
Merged

Translate gRPC FailedPrecondition as HTTP PreconditionFailed #657

merged 1 commit into from
May 23, 2018

Conversation

slomek
Copy link
Contributor

@slomek slomek commented May 21, 2018

After gRPC documentation (https://github.com/grpc/grpc-go/blob/master/codes/codes.go#L87-L91):

// (c) Use FailedPrecondition if the client should not retry until
// the system state has been explicitly fixed. E.g., if an "rmdir"
// fails because the directory is non-empty, FailedPrecondition
// should be returned since the client should not retry unless
// they have first fixed up the directory by deleting files from it.

Returning HTTP status code 400 (BadRequest) suggets that the problem is caused by the user's input, whereas it should indicate that the system is in an invalid state.

@achew22 achew22 merged commit 4ae34bd into grpc-ecosystem:master May 23, 2018
@slomek slomek deleted the fix/failed-precondition-http-code branch May 23, 2018 17:10
cjcormack added a commit to third-light/grpc-gateway that referenced this pull request Jul 22, 2019
Fixes grpc-ecosystem#972 (and reverses grpc-ecosystem#657). This now returns the semantically correct `400` response, rather than a `412`. This matches the gRPC documentation.
johanbrandhorst pushed a commit that referenced this pull request Jul 22, 2019
Fixes #972 (and reverses #657). This now returns the semantically correct `400` response, rather than a `412`. This matches the gRPC documentation.
adasari pushed a commit to adasari/grpc-gateway that referenced this pull request Apr 9, 2020
Fixes grpc-ecosystem#972 (and reverses grpc-ecosystem#657). This now returns the semantically correct `400` response, rather than a `412`. This matches the gRPC documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants