gunli commented on code in PR #1143:
URL: https://github.com/apache/pulsar-client-go/pull/1143#discussion_r1436059920


##########
pulsar/producer_partition.go:
##########
@@ -51,14 +51,21 @@ const (
 )
 
 var (
-       errFailAddToBatch     = newError(AddToBatchFailed, "message add to 
batch failed")
-       errSendTimeout        = newError(TimeoutError, "message send timeout")
-       errSendQueueIsFull    = newError(ProducerQueueIsFull, "producer send 
queue is full")
-       errContextExpired     = newError(TimeoutError, "message send context 
expired")
-       errMessageTooLarge    = newError(MessageTooBig, "message size exceeds 
MaxMessageSize")
-       errMetaTooLarge       = newError(InvalidMessage, "message metadata size 
exceeds MaxMessageSize")
-       errProducerClosed     = newError(ProducerClosed, "producer already been 
closed")
-       errMemoryBufferIsFull = newError(ClientMemoryBufferIsFull, "client 
memory buffer is full")
+       ErrFailAddToBatch     = newError(AddToBatchFailed, "message add to 
batch failed")
+       ErrSendTimeout        = newError(TimeoutError, "message send timeout")
+       ErrSendQueueIsFull    = newError(ProducerQueueIsFull, "producer send 
queue is full")
+       ErrContextExpired     = newError(TimeoutError, "message send context 
expired")
+       ErrMessageTooLarge    = newError(MessageTooBig, "message size exceeds 
MaxMessageSize")
+       ErrMetaTooLarge       = newError(InvalidMessage, "message metadata size 
exceeds MaxMessageSize")
+       ErrProducerClosed     = newError(ProducerClosed, "producer already been 
closed")
+       ErrMemoryBufferIsFull = newError(ClientMemoryBufferIsFull, "client 
memory buffer is full")
+       ErrSchema             = newError(SchemaFailure, "schema error")
+       ErrTransaction        = errors.New("transaction error")
+       ErrInvalidMessage     = newError(InvalidMessage, "invalid message")
+       ErrTopicNotfound      = newError(TopicNotFound, "topic not found")
+       ErrTopicTerminated    = newError(TopicTerminated, "topic terminated")
+       ErrProducerBlocked    = newError(ProducerBlockedQuotaExceededException, 
"producer blocked")

Review Comment:
   done



##########
pulsar/producer_partition.go:
##########
@@ -449,25 +456,25 @@ func (p *partitionProducer) reconnectToBroker() {
                if strings.Contains(errMsg, errMsgTopicNotFound) {
                        // when topic is deleted, we should give up 
reconnection.
                        p.log.Warn("Topic not found, stop reconnecting, close 
the producer")
-                       p.doClose(newError(TopicNotFound, err.Error()))
+                       p.doClose(joinErrors(ErrTopicNotfound, err))
                        break
                }
 
                if strings.Contains(errMsg, errMsgTopicTerminated) {
                        p.log.Warn("Topic was terminated, failing pending 
messages, stop reconnecting, close the producer")
-                       p.doClose(newError(TopicTerminated, err.Error()))
+                       p.doClose(joinErrors(ErrTopicTerminated, err))
                        break
                }
 
                if strings.Contains(errMsg, 
errMsgProducerBlockedQuotaExceededException) {
                        p.log.Warn("Producer was blocked by quota exceed 
exception, failing pending messages, stop reconnecting")
-                       
p.failPendingMessages(newError(ProducerBlockedQuotaExceededException, 
err.Error()))
+                       p.failPendingMessages(joinErrors(ErrProducerBlocked, 
err))

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to