Skip to content

Commit

Permalink
utils: Catch IntervalError instead of AssertionError when giving sche…
Browse files Browse the repository at this point in the history
…dule incorrect input
  • Loading branch information
ljanyst committed Feb 3, 2019
1 parent 55da4ef commit fe02f5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scrapy_do/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from distutils.spawn import find_executable
from datetime import datetime
from schedule import Job as SchJob
from schedule import IntervalError


#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -192,7 +193,7 @@ def _parse_spec(job, spec):

try:
directive_map[directive](job, *args)
except AssertionError as e:
except IntervalError as e:
raise ValueError(str(e))

return job
Expand Down

0 comments on commit fe02f5c

Please sign in to comment.