Skip to content

Commit a84c97d

Browse files
committed
use the new error evaluation pe review comments
1 parent aac6b57 commit a84c97d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pulsar/producer_partition.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ func newPartitionProducer(client *client, topic string, options *ProducerOptions
223223
}
224224
p.log.WithError(err).Error("Failed to create producer at newPartitionProducer")
225225
errMsg := err.Error()
226-
if strings.Contains(errMsg, errTopicNotFount) {
226+
if errors.Is(err, ErrTopicNotfound)
227227
// when topic is not found, do not attempt to reconnect
228228
p.log.Warn("Failed to create producer due to Topic Not Found")
229229
break
230230
}
231231

232-
if strings.Contains(errMsg, "TopicTerminatedError") {
232+
if errors.Is(err, ErrTopicTerminated)
233233
p.log.Info("Topic was terminated, failing pending messages, will not create producer")
234234
break
235235
}

0 commit comments

Comments
 (0)