from datetime import datetime
from croniter import croniter
it = croniter("0-1& * * * *", datetime.now())
Running this throws a ValueError, not any of the CroniterError subclasses. What is the intended behavior? Would returning anything other than CroniterError count as bug?
From a consumer perspective, when handling user-submitted cron expressions, it would be nice to be able to wrap croniter calls in try ... except CroniterError. Currently, for the sake of safety, I catch all exceptions:
try:
... initialize croniter, iterate over datetimes ...
except:
... assume the user-submitted cron expression is not valid ...
A test sample:
Running this throws a
ValueError
, not any of theCroniterError
subclasses. What is the intended behavior? Would returning anything other thanCroniterError
count as bug?From a consumer perspective, when handling user-submitted cron expressions, it would be nice to be able to wrap croniter calls in
try ... except CroniterError
. Currently, for the sake of safety, I catch all exceptions: