Skip to content

Commit

Permalink
Stop marshalling any.Any types unnecessarily.
Browse files Browse the repository at this point in the history
Fixes #576.
  • Loading branch information
johanbrandhorst authored Mar 17, 2018
1 parent 58f78b9 commit 762475a
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions runtime/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,7 @@ func DefaultHTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w
body := &errorBody{
Error: s.Message(),
Code: int32(s.Code()),
}

for _, detail := range s.Details() {
if det, ok := detail.(proto.Message); ok {
a, err := ptypes.MarshalAny(det)
if err != nil {
grpclog.Printf("Failed to marshal any: %v", err)
} else {
body.Details = append(body.Details, a)
}
}
Details: s.Proto().GetDetails(),
}

buf, merr := marshaler.Marshal(body)
Expand Down

0 comments on commit 762475a

Please sign in to comment.