Skip to content

Commit 34b351a

Browse files
committed
chore: log error
1 parent e21ca47 commit 34b351a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/streamer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/huantt/kafka-dump/pkg/kafka_utils"
88
"github.com/huantt/kafka-dump/pkg/log"
99
"github.com/spf13/cobra"
10+
"log/slog"
1011
"time"
1112
)
1213

@@ -85,7 +86,8 @@ func CreateStreamCmd() (*cobra.Command, error) {
8586
)
8687
transferredCount, err := streamer.Run()
8788
if err != nil {
88-
panic(err)
89+
slog.Error(err.Error())
90+
return
8991
}
9092
log.Infof("Transferred %d messages from %s to %s", transferredCount, fromTopic, toTopic)
9193
},

0 commit comments

Comments
 (0)