alextinng commented on PR #13841:
URL:
https://github.com/apache/dolphinscheduler/pull/13841#issuecomment-1492806666
It's true that validating a cron expression depends on wether an exception
occur is not precise, however, we can still narrow the search,according to the
method comment, an IllegalArgumentException is thrown if expression is wrong,
so catch IllegalArgumentException rather than Exception is a better idea.
/**
* Parse string with cron expression.
*
* @param expression - cron expression, never null
* @return Cron instance, corresponding to cron expression received
* @throws java.lang.IllegalArgumentException if expression does not
match cron definition
*/
public Cron parse(final String expression) {
......
}
--
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]