Skip to content

Commit

Permalink
[improve][broker] Propagate cause exception in TopicBusyException whe…
Browse files Browse the repository at this point in the history
…n applicable (#22596)
  • Loading branch information
lhotari authored Apr 26, 2024
1 parent 69839c7 commit 3b9602c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ public static class TopicBusyException extends BrokerServiceException {
public TopicBusyException(String msg) {
super(msg);
}

public TopicBusyException(String msg, Throwable t) {
super(msg, t);
}
}

public static class TopicNotFoundException extends BrokerServiceException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ private CompletableFuture<Void> delete(boolean failIfHasSubscriptions, boolean c
}
}).exceptionally(ex -> {
deleteFuture.completeExceptionally(
new TopicBusyException("Failed to close clients before deleting topic."));
new TopicBusyException("Failed to close clients before deleting topic.",
FutureUtil.unwrapCompletionException(ex)));
return null;
});
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,8 @@ public void deleteLedgerComplete(Object ctx) {
}).exceptionally(ex->{
unfenceTopicToResume();
deleteFuture.completeExceptionally(
new TopicBusyException("Failed to close clients before deleting topic."));
new TopicBusyException("Failed to close clients before deleting topic.",
FutureUtil.unwrapCompletionException(ex)));
return null;
});

Expand Down

0 comments on commit 3b9602c

Please sign in to comment.