Skip to content

Commit

Permalink
♻️ Fix
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <[email protected]>
  • Loading branch information
vankichi committed Oct 1, 2024
1 parent d6b6c8c commit 3933a21
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pkg/gateway/lb/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ func (s *server) exists(ctx context.Context, uuid string) (id *payload.Object_ID
target + " deadline_exceeded: " + err.Error())
code = codes.DeadlineExceeded
default:
st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.ExistsRPCName+" API meta "+uuid+"'s uuid not found",
&errdetails.RequestInfo{
RequestId: uuid,
ServingData: errdetails.Serialize(meta),
},
&errdetails.ResourceInfo{
ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.ExistsRPCName,
ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target),
})
if st != nil {
code = st.Code()
} else {
code = codes.NotFound
st, ok := status.FromError(err)
code = st.Code()
msg = fmt.Sprintf("%s's uuid %s", uuid, st.Message())
if !ok {
if st == nil {
code = codes.NotFound
msg = fmt.Sprintf("%s's uuid not found", uuid)
} else {
code = st.Code()
if st.Message() == "" {
msg = fmt.Sprintf("%s's uuid not found", uuid)

Check warning on line 143 in pkg/gateway/lb/handler/grpc/handler.go

View check run for this annotation

Codecov / codecov/patch

pkg/gateway/lb/handler/grpc/handler.go#L133-L143

Added lines #L133 - L143 were not covered by tests
}
}
}
attrs = trace.FromGRPCStatus(code, msg)
}
Expand Down

0 comments on commit 3933a21

Please sign in to comment.