Skip to content

Commit

Permalink
use the new error evaluation pe review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzming committed Jan 12, 2024
1 parent aac6b57 commit a84c97d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pulsar/producer_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ func newPartitionProducer(client *client, topic string, options *ProducerOptions
}
p.log.WithError(err).Error("Failed to create producer at newPartitionProducer")
errMsg := err.Error()
if strings.Contains(errMsg, errTopicNotFount) {
if errors.Is(err, ErrTopicNotfound)
// when topic is not found, do not attempt to reconnect
p.log.Warn("Failed to create producer due to Topic Not Found")
break
}

if strings.Contains(errMsg, "TopicTerminatedError") {
if errors.Is(err, ErrTopicTerminated)
p.log.Info("Topic was terminated, failing pending messages, will not create producer")
break
}
Expand Down

0 comments on commit a84c97d

Please sign in to comment.