Technoboy- commented on code in PR #15621:
URL: https://github.com/apache/pulsar/pull/15621#discussion_r875402080


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/Namespaces.java:
##########
@@ -561,14 +579,22 @@ public void setAutoTopicCreation(@Suspended final 
AsyncResponse asyncResponse,
     public void removeAutoTopicCreation(@Suspended final AsyncResponse 
asyncResponse,
                                         @PathParam("property") String 
property, @PathParam("cluster") String cluster,
                                         @PathParam("namespace") String 
namespace) {
-        try {
             validateNamespaceName(property, cluster, namespace);
-            internalRemoveAutoTopicCreation(asyncResponse);
-        } catch (RestException e) {
-            asyncResponse.resume(e);
-        } catch (Exception e) {
-            asyncResponse.resume(new RestException(e));
-        }
+            internalSetAutoTopicCreationAsync(null)
+                    .thenAccept(__ -> {
+                        log.info("[{}] Successfully remove autoTopicCreation 
on namespace {}", clientAppId());
+                        asyncResponse.resume(Response.noContent().build());
+                    })
+                    .exceptionally(e -> {
+                        log.error("[{}] Failed to remove autoTopicCreation 
status on namespace {}", clientAppId(),
+                                namespaceName,
+                                e.getCause());
+                        if (e.getCause() instanceof NotFoundException) {
+                            asyncResponse.resume(new 
RestException(Status.NOT_FOUND, "Namespace does not exist"));
+                        }

Review Comment:
   Need else hare



-- 
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-unsubscr...@pulsar.apache.org

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

Reply via email to