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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]