diff --git a/examples/avro_generic_consumer_example/avro_generic_consumer_example.go b/examples/avro_generic_consumer_example/avro_generic_consumer_example.go index 15ac403a4..7ed3e67e1 100644 --- a/examples/avro_generic_consumer_example/avro_generic_consumer_example.go +++ b/examples/avro_generic_consumer_example/avro_generic_consumer_example.go @@ -75,6 +75,10 @@ func main() { } err = c.SubscribeTopics(topics, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %v\n", err) + os.Exit(1) + } run := true diff --git a/examples/avro_specific_consumer_example/avro_specific_consumer_example.go b/examples/avro_specific_consumer_example/avro_specific_consumer_example.go index 47e277596..1b5279dad 100644 --- a/examples/avro_specific_consumer_example/avro_specific_consumer_example.go +++ b/examples/avro_specific_consumer_example/avro_specific_consumer_example.go @@ -75,6 +75,10 @@ func main() { } err = c.SubscribeTopics(topics, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %v\n", err) + os.Exit(1) + } run := true diff --git a/examples/consumer_example/consumer_example.go b/examples/consumer_example/consumer_example.go index 24730668c..c17ef6fd9 100644 --- a/examples/consumer_example/consumer_example.go +++ b/examples/consumer_example/consumer_example.go @@ -69,6 +69,10 @@ func main() { fmt.Printf("Created Consumer %v\n", c) err = c.SubscribeTopics(topics, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %v\n", err) + os.Exit(1) + } if err != nil { fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %s\n", err) diff --git a/examples/json_consumer_example/json_consumer_example.go b/examples/json_consumer_example/json_consumer_example.go index ea864fbdb..ab895e2d3 100644 --- a/examples/json_consumer_example/json_consumer_example.go +++ b/examples/json_consumer_example/json_consumer_example.go @@ -75,6 +75,10 @@ func main() { } err = c.SubscribeTopics(topics, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %v\n", err) + os.Exit(1) + } run := true diff --git a/examples/protobuf_consumer_example/protobuf_consumer_example.go b/examples/protobuf_consumer_example/protobuf_consumer_example.go index 536509aa9..f6f3a50fa 100644 --- a/examples/protobuf_consumer_example/protobuf_consumer_example.go +++ b/examples/protobuf_consumer_example/protobuf_consumer_example.go @@ -80,6 +80,10 @@ func main() { deser.ProtoRegistry.RegisterMessage((&User{}).ProtoReflect().Type()) err = c.SubscribeTopics(topics, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %v\n", err) + os.Exit(1) + } run := true diff --git a/examples/stats_example/stats_example.go b/examples/stats_example/stats_example.go index bb5bf18bb..8b2a65730 100644 --- a/examples/stats_example/stats_example.go +++ b/examples/stats_example/stats_example.go @@ -63,6 +63,10 @@ func main() { fmt.Printf("Created Consumer %v\n", c) err = c.SubscribeTopics(topics, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to subscribe to topics: %v\n", err) + os.Exit(1) + } run := true