Skip to content

Commit

Permalink
Update internal/net/grpc/status/status.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Yusuke Kato <[email protected]>
  • Loading branch information
kpango and coderabbitai[bot] authored Sep 21, 2024
1 parent b30ac97 commit 25c6bd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/net/grpc/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,13 @@ func withDetails(st *Status, err error, details ...any) *Status {
}
}
code := st.Code()
sst, err := status.New(code, err.Error()).WithDetails(msgs...)
var errMsg string
if err != nil {
errMsg = err.Error()
} else {
errMsg = st.Message()
}
sst, err := status.New(code, errMsg).WithDetails(msgs...)
if err == nil {
st = sst
}
Expand Down

0 comments on commit 25c6bd6

Please sign in to comment.