Skip to content

Commit

Permalink
[improve][broker] Avoid print redirect exception log when get list fr…
Browse files Browse the repository at this point in the history
…om bundle (#20846)

(cherry picked from commit 9256407)
  • Loading branch information
Demogorgon314 authored and lhotari committed Mar 6, 2024
1 parent 3fcaa0a commit e530c8b
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,25 +461,20 @@ public void getListFromBundle(
}
asyncResponse.resume(topicList);
}).exceptionally(ex -> {
Throwable realCause = FutureUtil.unwrapCompletionException(ex);
log.error("[{}] Failed to list topics on namespace bundle {}/{}", clientAppId(),
namespaceName, bundleRange, realCause);
if (realCause instanceof WebApplicationException) {
asyncResponse.resume(realCause);
} else {
asyncResponse.resume(new RestException(realCause));
if (!isRedirectException(ex)) {
log.error("[{}] Failed to list topics on namespace bundle {}/{}", clientAppId(),
namespaceName, bundleRange, ex);
}
resumeAsyncResponseExceptionally(asyncResponse, ex);
return null;
});
}
}).exceptionally(ex -> {
log.error("[{}] Failed to list topics on namespace bundle {}/{}", clientAppId(),
namespaceName, bundleRange, ex);
if (ex.getCause() instanceof WebApplicationException) {
asyncResponse.resume(ex.getCause());
} else {
asyncResponse.resume(new RestException(ex.getCause()));
if (!isRedirectException(ex)) {
log.error("[{}] Failed to list topics on namespace bundle {}/{}", clientAppId(),
namespaceName, bundleRange, ex);
}
resumeAsyncResponseExceptionally(asyncResponse, ex);
return null;
});
}
Expand Down

0 comments on commit e530c8b

Please sign in to comment.