-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve exception info for invaild time-related option #12828
Improve exception info for invaild time-related option #12828
Conversation
try { | ||
offloadAfterElapsed = TimeUnit.SECONDS.toMillis( | ||
RelativeTimeUtil.parseRelativeTimeInSeconds(offloadAfterElapsedStr)); | ||
} catch (IllegalArgumentException exception) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this case is different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it is my mistake and I have corrected (PulsarAdminException
-> ParameterException
), PTAL again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
(cherry picked from commit 60f5475)
Motivation
Check the validity of the time-related option in CLI tools and give a more friendly / concise prompt message when time invaild. Currently, it directly display the exception stack info as below:
Modifications
ParameterException
whenIllegalArgumentException
occurs when executingRelativeTimeUtil.parseRelativeTimeInSeconds()
Documentation
Automatically generate doc through code
doc