Return err as nil when replying with DROP status (#349)

Signed-off-by: longshine <longxianghe@gmail.com>

Signed-off-by: longshine <longxianghe@gmail.com>
This commit is contained in:
longshine 2023-01-23 08:08:23 +08:00 committed by GitHub
parent 4288f414a6
commit cae6fc0130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ func (s *Server) OnTopicEvent(ctx context.Context, in *runtimev1pb.TopicEventReq
if retry {
return &runtimev1pb.TopicEventResponse{Status: runtimev1pb.TopicEventResponse_RETRY}, err
}
return &runtimev1pb.TopicEventResponse{Status: runtimev1pb.TopicEventResponse_DROP}, err
return &runtimev1pb.TopicEventResponse{Status: runtimev1pb.TopicEventResponse_DROP}, nil
}
return &runtimev1pb.TopicEventResponse{Status: runtimev1pb.TopicEventResponse_RETRY}, fmt.Errorf(
"pub/sub and topic combination not configured: %s/%s",

View File

@ -217,7 +217,7 @@ func TestTopicWithErrors(t *testing.T) {
PubsubName: sub2.PubsubName,
}
resp, err := server.OnTopicEvent(ctx, in)
assert.Error(t, err)
assert.NoError(t, err)
assert.Equal(t, resp.GetStatus(), runtime.TopicEventResponse_DROP)
})