Skip to content

Commit

Permalink
Enhanced Error README documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lu4nm3 committed Sep 28, 2018
1 parent 61934b8 commit d3f7438
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Expand Up @@ -272,8 +272,23 @@ this to support other date types.

Most of the time you're able to use types to effectively figure out which multipart expression permutations are
supported by a `Cron` expression as well as which part expressions are supported by a particular multipart expression.

For example, only `DayOfMonth` supports the `LastWeekday` part expression and using `LastWeekday` for any other
multipart expression will result in a compilation error.
multipart expression results in a compilation error:

```scala
scala> DayOfMonth(LW)
res0: Either[nextime.Error,nextime.DayOfMonth] = Right(DayOfMonth(List(LastWeekday)))

scala> Hour(LW)
<console>:15: error: overloaded method value apply with alternatives:
(parts: List[nextime.HourPart])Either[nextime.Error,nextime.Hour] <and>
(head: nextime.HourPart,tail: nextime.HourPart*)Either[nextime.Error,nextime.Hour] <and>
(hourExpression: String)Either[nextime.Error,nextime.Hour]
cannot be applied to (nextime.LastWeekday.type)
Hour(LW)
^
```

For the times when this isn't enough, Nextime provides an intricate error system that is used to describe issues that
your cron expression and its sub-expressions may have.
Expand Down

0 comments on commit d3f7438

Please sign in to comment.