mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 01:08:26 -05:00
Better error message when time is not parseable
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.
This commit is contained in:
@@ -160,7 +160,10 @@ module Jekyll
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user