[fix][admin] Fix unWarp Exception when getPoliciesAsync
@@ -907,10 +907,11 @@ public abstract class PulsarWebResource {
validationFuture.completeExceptionally(new RestException(Status.NOT_FOUND, "Namespace not found"));
}
}).exceptionally(ex -> {
+ Throwable cause = FutureUtil.unwrapCompletionException(ex);
String msg = String.format("Failed to validate global cluster configuration : cluster=%s ns=%s emsg=%s",
- localCluster, namespace, ex.getMessage());
+ localCluster, namespace, cause.getMessage());
log.error(msg);
- validationFuture.completeExceptionally(new RestException(ex));
+ validationFuture.completeExceptionally(new RestException(cause));
return null;
});
return validationFuture;
