hangc0276 commented on a change in pull request #13950:
URL: https://github.com/apache/pulsar/pull/13950#discussion_r792261025



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -1273,12 +1273,13 @@ protected void handleProducer(final CommandProducer 
cmdProducer) {
                     return null;
                 }
 
+                // Do not print stack traces for expected exceptions
                 if (cause instanceof NoSuchElementException) {
                     cause = new TopicNotFoundException("Topic Not Found.");
-                }
-                if (!Exceptions.areExceptionsPresentInChain(cause,
+                    log.error("[{}] Failed to load topic {}, producerId={}: 
Topic not found", remoteAddress, topicName,
+                            producerId);
+                } else if (!Exceptions.areExceptionsPresentInChain(cause,
                         ServiceUnitNotReadyException.class, 
ManagedLedgerException.class)) {
-                    // Do not print stack traces for expected exceptions
                     log.error("[{}] Failed to create topic {}, producerId={}",
                             remoteAddress, topicName, producerId, exception);

Review comment:
       Does it still print the exception stack in `exception` ?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to