You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/07 01:35:38 UTC

[GitHub] [pulsar] RobertIndie commented on a change in pull request #14123: Make ``TenantsBase#createTenant`` to pure async

RobertIndie commented on a change in pull request #14123:
URL: https://github.com/apache/pulsar/pull/14123#discussion_r800266580



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TenantsBase.java
##########
@@ -120,58 +124,34 @@ public void getTenantAdmin(@Suspended final AsyncResponse asyncResponse,
     public void createTenant(@Suspended final AsyncResponse asyncResponse,
             @ApiParam(value = "The tenant name") @PathParam("tenant") String tenant,
             @ApiParam(value = "TenantInfo") TenantInfoImpl tenantInfo) {
-
-        final String clientAppId = clientAppId();
-        try {
-            validateSuperUserAccess();
-            validatePoliciesReadOnlyAccess();
-            validateClusters(tenantInfo);
-            NamedEntity.checkName(tenant);
-        } catch (IllegalArgumentException e) {
-            log.warn("[{}] Failed to create tenant with invalid name {}", clientAppId(), tenant, e);
-            asyncResponse.resume(new RestException(Status.PRECONDITION_FAILED, "Tenant name is not valid"));

Review comment:
       It seems that we have removed this exception. It will make users confused if will just throw the `IllegalArgumentException` without other information.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org