lifepuzzlefun commented on code in PR #20152:
URL: https://github.com/apache/pulsar/pull/20152#discussion_r1172292016


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -3045,6 +3045,10 @@ protected CompletableFuture<Response> 
internalExamineMessageAsync(String initial
                     try {
                         PersistentTopic persistentTopic = (PersistentTopic) 
topic;
                         long totalMessage = 
persistentTopic.getNumberOfEntries();
+                        if(totalMessage <= 0) {
+                            throw new 
RestException(Status.INTERNAL_SERVER_ERROR,

Review Comment:
   i think we can change http status code to 422 Unprocessable Content or 412 
Precondition Failed



-- 
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