Skip to content

Commit

Permalink
unwrap exception
Browse files Browse the repository at this point in the history
  • Loading branch information
HQebupt committed Jan 29, 2022
1 parent 6b60661 commit d65be28
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,17 @@ protected void validateAdminAccessForTenant(String tenant) {

protected static void validateAdminAccessForTenant(PulsarService pulsar, String clientAppId,
String originalPrincipal, String tenant,
AuthenticationDataSource authenticationData)
throws Exception {
validateAdminAccessForTenantAsync(pulsar, clientAppId, originalPrincipal, tenant, authenticationData).get();
AuthenticationDataSource authenticationData) {
try {
validateAdminAccessForTenantAsync(pulsar, clientAppId, originalPrincipal, tenant, authenticationData).get();
} catch (InterruptedException | ExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof WebApplicationException){
throw (WebApplicationException) cause;
} else {
throw new RestException(cause);
}
}
}

/**
Expand Down

0 comments on commit d65be28

Please sign in to comment.