Skip to content

Commit ecf1225

Browse files
authored
Merge pull request #256 from tmc/fix_error_code_tag
Correct runtime.errorBody protobuf field tag
2 parents 84398b9 + 3ec1df8 commit ecf1225

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var (
6464

6565
type errorBody struct {
6666
Error string `protobuf:"bytes,1,name=error" json:"error"`
67-
Code int `protobuf:"bytes,2,name=code" json:"code"`
67+
Code int32 `protobuf:"varint,2,name=code" json:"code"`
6868
}
6969

7070
//Make this also conform to proto.Message for builtin JSONPb Marshaler
@@ -85,7 +85,7 @@ func DefaultHTTPError(ctx context.Context, marshaler Marshaler, w http.ResponseW
8585
w.Header().Set("Content-Type", marshaler.ContentType())
8686
body := &errorBody{
8787
Error: grpc.ErrorDesc(err),
88-
Code: int(grpc.Code(err)),
88+
Code: int32(grpc.Code(err)),
8989
}
9090

9191
buf, merr := marshaler.Marshal(body)

0 commit comments

Comments
 (0)