Skip to content

Commit

Permalink
Translate gRPC FailedPrecondition as HTTP PreconditionFailed
Browse files Browse the repository at this point in the history
  • Loading branch information
slomek authored and achew22 committed May 23, 2018
1 parent cb416f8 commit 4ae34bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/errors.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package runtime

import (
"context"
"io"
"net/http"

"context"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
Expand Down Expand Up @@ -38,7 +38,7 @@ func HTTPStatusFromCode(code codes.Code) int {
case codes.ResourceExhausted:
return http.StatusTooManyRequests
case codes.FailedPrecondition:
return http.StatusBadRequest
return http.StatusPreconditionFailed
case codes.Aborted:
return http.StatusConflict
case codes.OutOfRange:
Expand Down

0 comments on commit 4ae34bd

Please sign in to comment.