yuruguo opened a new pull request #13002:
URL: https://github.com/apache/pulsar/pull/13002


   ### Motivation
   We should check the parameters releted to `size` and throw 
`ParameterException` when there is an exception, which can avoid displaying 
stack information on the client.
   Currently, the lack of verification about `size` will directly display the 
exception, as below:
   ```
   bin/pulsar-admin topics set-backlog-quota --limit 70z --policy 
producer_exception public/default/test
   java.lang.NumberFormatException: For input string: "70z"
        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Long.parseLong(Long.java:589)
        at java.lang.Long.parseLong(Long.java:631)
        at 
org.apache.pulsar.admin.cli.CliCommand.validateSizeString(CliCommand.java:102)
        at 
org.apache.pulsar.admin.cli.CmdTopics$SetBacklogQuota.run(CmdTopics.java:1148)
        at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:86)
        at 
org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:282)
        at 
org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:330)
   ```
   
   ### Documentation
   - [x] `no-need-doc`
   


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


Reply via email to