Show input in error message
Show date input in error message to make it easier for user to find infringing date/file
This commit is contained in:
parent
d5322a73bf
commit
4cfbdb07bb
|
@ -89,10 +89,10 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns the parsed date if successful, throws a FatalException
|
# Returns the parsed date if successful, throws a FatalException
|
||||||
# if not
|
# if not
|
||||||
def parse_date(input, msg = "Invalid date: could not be parsed.")
|
def parse_date(input, msg = "Input could not be parsed.")
|
||||||
Time.parse(input)
|
Time.parse(input)
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
raise Errors::FatalException.new(msg)
|
raise Errors::FatalException.new("Invalid date '#{input}': " + msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue