Skip to content

Commit

Permalink
Call inspect on the time that couldn't be parsed
Browse files Browse the repository at this point in the history
This commit makes the error message clearer when parsing fails due to a trailing
space in a string with cron syntax.

Fixes #726
Fixes #730
  • Loading branch information
ignisf committed May 3, 2018
1 parent 92e90f0 commit e4507e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

* Enable to execute whenever's task independently without setting :release_path or :whenever_path [ta1kt0me](https://github.com/javan/whenever/pull/729)

* Make error message clearer when parsing cron syntax fails due to a trailing space [ignisf](https://github.com/javan/whenever/pull/744)

### 0.10.0 / November 19, 2017

* Modify wheneverize to allow for the creating of 'config' directory when not present
Expand Down
2 changes: 1 addition & 1 deletion lib/whenever/cron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def parse_as_string
return (timing << i) * " " if string.downcase.index(day)
end

raise ArgumentError, "Couldn't parse: #{@time}"
raise ArgumentError, "Couldn't parse: #{@time.inspect}"
end

def range_or_integer(at, valid_range, name)
Expand Down

0 comments on commit e4507e2

Please sign in to comment.