Skip to content

Commit

Permalink
Merge pull request #256 from tmc/fix_error_code_tag
Browse files Browse the repository at this point in the history
Correct runtime.errorBody protobuf field tag
  • Loading branch information
tmc committed Nov 19, 2016
2 parents 84398b9 + 3ec1df8 commit ecf1225
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
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit ecf1225

Please sign in to comment.