mattisonchao commented on code in PR #23831:
URL: https://github.com/apache/pulsar/pull/23831#discussion_r1993004258


##########
pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataTeardown.java:
##########
@@ -222,9 +222,19 @@ private static void deleteLedger(BookKeeper bookKeeper, 
long ledgerId) {
             if (log.isDebugEnabled()) {
                 log.debug("Delete ledger id: {}", ledgerId);
             }
-        } catch (InterruptedException | BKException e) {
-            log.error("Failed to delete ledger {}: {}", ledgerId, e);
-            throw new RuntimeException(e);
+        } catch (InterruptedException | BKException ex) {
+            if (ex instanceof BKException bkException) {
+                switch (bkException.getCode()) {
+                    case BKException.Code.NoSuchLedgerExistsException:
+                    case 
BKException.Code.NoSuchLedgerExistsOnMetadataServerException:
+                    case BKException.Code.NoSuchEntryException:

Review Comment:
   applied



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