agilord/cron

Support better exception handling on parse

bsutton opened this issue · 3 comments

Currently when parsing a schedule the cron library throws an Exception when a parse fails.

This is difficult to catch as it is too generic.

Can we replace this with a specific exception such as:

ScheduleParseException
ParseException

or maybe FormatException - not my preferred as it is used by other functions.

isoos commented

I'm down for ScheduleParseException extends/implements FormatException. Are you interested creating a PR for it?

I created the PR myself as it appears it has not been maintained for some time.

Please check back when you have time @isoos :)