-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
When the year field starts with a digit but ends with non-digit Parser.parse crashes with CaseClauseError. See below:
iex(1)> Crontab.CronExpression.Parser.parse "* * * * * 1x"
** (CaseClauseError) no case clause matching: {1, "x"}
(crontab 1.2.0) lib/crontab/cron_expression/parser.ex:380: Crontab.CronExpression.Parser.clean_value/2
(elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
(crontab 1.2.0) lib/crontab/cron_expression/parser.ex:185: Crontab.CronExpression.Parser.interpret/2
(crontab 1.2.0) lib/crontab/cron_expression/parser.ex:166: Crontab.CronExpression.Parser.interpret/3
iex:21: (file)
No other field has this behavior. Below you can see it returns the error tuple as expected:
iex(2)> Crontab.CronExpression.Parser.parse "1x * * * * *"
{:error, "Can't parse 1x as minute."}
crontab version: 1.2.0
Metadata
Metadata
Assignees
Labels
No labels