Skip to content

Commit

Permalink
Better error message when time is not parseable
Browse files Browse the repository at this point in the history
Give the full path of the file that cannot be parsed so the user can locate it easier. Follow up the error message with helpful instructions: they can resolve the error by fixing the date or excluding the file or directory from being processed.
  • Loading branch information
schneems committed Dec 18, 2013
1 parent 12a55b8 commit 22017d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/jekyll/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ def process(name)
self.slug = slug
self.ext = ext
rescue ArgumentError
raise FatalException.new("Post #{name} does not have a valid date.")
path = File.join(@dir || "", name)
msg = "Post '#{path}' does not have a valid date.\n"
msg << "Fix the date, or exclude the file or directory from being processed"
raise FatalException.new(msg)
end

# The generated directory into which the post will be placed
Expand Down

0 comments on commit 22017d0

Please sign in to comment.