Technoboy- commented on code in PR #22715:
URL: https://github.com/apache/pulsar/pull/22715#discussion_r1609159774
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java:
##########
@@ -506,6 +507,18 @@ protected void validateClusterExists(String cluster) {
}
}
+ protected CompletableFuture<Void> validateNamespaceExists(NamespaceName
namespace) {
+ try {
+ if (namespaceResources().namespaceExists(namespace)) {
+ return CompletableFuture.completedFuture(null);
+ } else {
+ return FutureUtil.failedFuture(new
RestException(Status.NOT_FOUND, "Namespace does not exist"));
+ }
+ } catch (Exception e) {
+ return FutureUtil.failedFuture(e);
+ }
+ }
+
Review Comment:
Seems no need `try/catch`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]