Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing errors not in either left #327

Closed
damdev opened this issue Jun 18, 2020 · 3 comments · Fixed by #335
Closed

Parsing errors not in either left #327

damdev opened this issue Jun 18, 2020 · 3 comments · Fixed by #335

Comments

@damdev
Copy link

damdev commented Jun 18, 2020

scala> Cron("* * * * *")
java.util.NoSuchElementException: head of empty list
  at scala.collection.immutable.Nil$.head(List.scala:430)
  at scala.collection.immutable.Nil$.head(List.scala:427)
  at cron4s.parsing.CronTokenReader.first(parser.scala:26)
  at cron4s.parsing.CronTokenReader.first(parser.scala:25)
  at cron4s.parsing.BaseParser.handleError(base.scala:25)
  at cron4s.parsing.BaseParser.handleError$(base.scala:24)
  at cron4s.parsing.CronParser$.handleError(parser.scala:32)
  at cron4s.parsing.CronParser$.read(parser.scala:182)
  at cron4s.parsing.package$.$anonfun$parse$1(package.scala:26)
  at scala.util.Either.flatMap(Either.scala:341)
  at cron4s.parsing.package$.parse(package.scala:25)
  at cron4s.Cron$.parse(Cron.scala:50)
  at cron4s.Cron$.apply(Cron.scala:39)
  ... 36 elided

This should return a Left with a better Error

@alessandrovaccaro
Copy link

I see the same issue on 0.6.0.

@alonsodomin
Copy link
Owner

Released version 0.6.1 today which should fix this error

@alessandrovaccaro
Copy link

Thank you, this is really appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants