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/27 10:36:54 UTC
[GitHub] [pulsar] nicoloboschi commented on a change in pull request #13002: [pulsar-admin] Check the size options in cmd for topic and namespace
nicoloboschi commented on a change in pull request #13002:
URL: https://github.com/apache/pulsar/pull/13002#discussion_r757767311
##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java
##########
@@ -719,8 +719,14 @@ void run() throws PulsarAdminException {
@Override
void run() throws PulsarAdminException {
String namespace = validateNamespace(params);
- long sizeLimit = validateSizeString(limitStr);
+ long sizeLimit;
long retentionTimeInSec;
+ try {
+ sizeLimit = validateSizeString(limitStr);
+ } catch (IllegalArgumentException e) {
+ throw new ParameterException(String.format("Invalid retention policy type '%s'. Valid formats are: %s",
Review comment:
It would be better to specify the property with the invalid value, such as 'size limit'.
It's better to create a private method which build the error message, with property and valid values/examples as input
--
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