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 2021/11/22 13:30:40 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #12919: [Broker] Change create topic return error to Status.BAD_REQUEST

codelipenghui commented on a change in pull request #12919:
URL: https://github.com/apache/pulsar/pull/12919#discussion_r754280213



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -3694,7 +3694,7 @@ private Topic getTopicReference(TopicName topicName) {
             throw e;
         } catch (Exception e) {
             if (e.getCause() instanceof NotAllowedException) {
-                throw new RestException(Status.CONFLICT, e.getCause());
+                throw new RestException(Status.BAD_REQUEST, e.getCause());

Review comment:
       Interesting, do we through `NotAllowedException` for `pulsar().getBrokerService().getTopicIfExists()`? @congbobo184 Could you please help check how to improve this part? From the method name, we only get the topic ref if the topic exists, but looks like it also create topics.




-- 
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