Skip to content

Commit

Permalink
Fix branch-2.9 compatible issue. (#16779)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao authored Jul 25, 2022
1 parent 01dbf18 commit ca643ca
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -746,14 +746,15 @@ private CompletableFuture<Void> provisionPartitionedTopicPath(AsyncResponse asyn
}

protected void resumeAsyncResponseExceptionally(AsyncResponse asyncResponse, Throwable throwable) {
if (throwable instanceof WebApplicationException) {
asyncResponse.resume(throwable);
} else if (throwable instanceof BrokerServiceException.NotAllowedException) {
asyncResponse.resume(new RestException(Status.CONFLICT, throwable));
} else if (throwable instanceof PulsarAdminException) {
asyncResponse.resume(new RestException(((PulsarAdminException) throwable)));
Throwable realCause = FutureUtil.unwrapCompletionException(throwable);
if (realCause instanceof WebApplicationException) {
asyncResponse.resume(realCause);
} else if (realCause instanceof BrokerServiceException.NotAllowedException) {
asyncResponse.resume(new RestException(Status.CONFLICT, realCause));
} else if (realCause instanceof PulsarAdminException) {
asyncResponse.resume(new RestException(((PulsarAdminException) realCause)));
} else {
asyncResponse.resume(new RestException(throwable));
asyncResponse.resume(new RestException(realCause));
}
}

Expand Down

0 comments on commit ca643ca

Please sign in to comment.