diff --git a/runtime/errors.go b/runtime/errors.go index 0d3cb3bf3ca..5a51d02c0a9 100644 --- a/runtime/errors.go +++ b/runtime/errors.go @@ -64,7 +64,7 @@ var ( type errorBody struct { Error string `protobuf:"bytes,1,name=error" json:"error"` - Code int `protobuf:"bytes,2,name=code" json:"code"` + Code int32 `protobuf:"varint,2,name=code" json:"code"` } //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 w.Header().Set("Content-Type", marshaler.ContentType()) body := &errorBody{ Error: grpc.ErrorDesc(err), - Code: int(grpc.Code(err)), + Code: int32(grpc.Code(err)), } buf, merr := marshaler.Marshal(body)