feat: details to init kafka topics log

This commit is contained in:
Kirill 2023-07-07 13:31:41 +03:00
parent e161e4f851
commit a1a7598d06

@ -66,7 +66,7 @@ func Initialize(ctx context.Context, brokers, topics []string) error {
for _, topic := range topics { for _, topic := range topics {
isExist, err := kafka.TopicExists(ctx, topic) isExist, err := kafka.TopicExists(ctx, topic)
if err != nil { if err != nil {
lastInitializeErr = fmt.Errorf("failed to check is topic <%s> exist on <Initialize> of <BrokerService>: %w", topic, err) lastInitializeErr = fmt.Errorf("failed to check is topic <%s> exist on brokers <%+q>: %w", topic, brokers, err)
continue continue
} }
@ -75,7 +75,7 @@ func Initialize(ctx context.Context, brokers, topics []string) error {
} }
if err := kafka.CreateTopic(ctx, topic); err != nil { if err := kafka.CreateTopic(ctx, topic); err != nil {
lastInitializeErr = fmt.Errorf("failed to create topic <%s> on <Initialize> of <BrokerService>: %w", topic, err) lastInitializeErr = fmt.Errorf("failed to create topic <%s> on brokers <%+q>: %w", topic, brokers, err)
} }
} }