Skip to content

Commit d7a6a2a

Browse files
CaelRowleyrayokota
andauthored
Add error handling to json_consumer_example.go (confluentinc#1234)
Add error handling for SubscribeTopics call Co-authored-by: Robert Yokota <[email protected]>
1 parent cde2fe8 commit d7a6a2a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/json_consumer_example/json_consumer_example.go

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ func main() {
7676

7777
err = c.SubscribeTopics(topics, nil)
7878

79+
if err != nil {
80+
fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %s\n", err)
81+
os.Exit(1)
82+
}
83+
7984
run := true
8085

8186
for run {

0 commit comments

Comments
 (0)