Skip to content

Commit

Permalink
Use original error's message for gRPC error
Browse files Browse the repository at this point in the history
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
  • Loading branch information
jonnystoten committed Jul 22, 2022
1 parent 96157b0 commit 67e52c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions util/grpcerrors/grpcerrors.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ func ToGRPC(err error) error {
st = status.FromProto(pb)
}

if err.Error() != st.Message() {
pb := st.Proto()
pb.Message = err.Error()
st = status.FromProto(pb)
}

var details []proto.Message

for _, st := range stack.Traces(err) {
Expand Down

0 comments on commit 67e52c2

Please sign in to comment.