Skip to content

Commit c4fcf5b

Browse files
committed
Error Response when no matching functions
Send response to indicate no matching functions are found for the topic
1 parent ac30006 commit c4fcf5b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

types/invoker.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ func (i *Invoker) InvokeWithContext(ctx context.Context, topicMap *TopicMap, top
6363
}
6464

6565
matchedFunctions := topicMap.Match(topic)
66+
if len(matchedFunctions) == 0 {
67+
i.Responses <- InvokerResponse{
68+
Context: ctx,
69+
Error: fmt.Errorf("no functions to invoke"),
70+
}
71+
}
72+
6673
for _, matchedFunction := range matchedFunctions {
6774
log.Printf("Invoke function: %s", matchedFunction)
6875

0 commit comments

Comments
 (0)