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 2, 2024
1 parent d6b6c8c commit efbfe88
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pkg/gateway/lb/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,17 @@ 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 {
st, ok := status.FromError(err)
if ok && st != nil {

Check warning on line 134 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-L134

Added lines #L133 - L134 were not covered by tests
code = st.Code()
if st.Message() != "" {
msg = fmt.Sprintf("%s's uuid %s", uuid, st.Message())
} else {
msg = fmt.Sprintf("%s's uuid not found", uuid)

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

View check run for this annotation

Codecov / codecov/patch

pkg/gateway/lb/handler/grpc/handler.go#L136-L139

Added lines #L136 - L139 were not covered by tests
}
} else {
code = codes.NotFound
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#L143

Added line #L143 was not covered by tests
}
attrs = trace.FromGRPCStatus(code, msg)
}
Expand Down

0 comments on commit efbfe88

Please sign in to comment.