Change exception type
This commit is contained in:
parent
7cec996f90
commit
ec85c49de3
|
@ -41,7 +41,7 @@ module Jekyll
|
||||||
|
|
||||||
def validate_file_name
|
def validate_file_name
|
||||||
if @file !~ /^[a-zA-Z0-9_\/\.-]+$/ || @file =~ /\.\// || @file =~ /\/\./
|
if @file !~ /^[a-zA-Z0-9_\/\.-]+$/ || @file =~ /\.\// || @file =~ /\/\./
|
||||||
raise SyntaxError.new <<-eos
|
raise ArgumentError.new <<-eos
|
||||||
Invalid syntax for include tag. File contains invalid characters or sequences:
|
Invalid syntax for include tag. File contains invalid characters or sequences:
|
||||||
|
|
||||||
#{@file}
|
#{@file}
|
||||||
|
@ -57,7 +57,7 @@ eos
|
||||||
def validate_params
|
def validate_params
|
||||||
full_valid_syntax = Regexp.compile('\A\s*(?:' + VALID_SYNTAX.to_s + '(?=\s|\z)\s*)*\z')
|
full_valid_syntax = Regexp.compile('\A\s*(?:' + VALID_SYNTAX.to_s + '(?=\s|\z)\s*)*\z')
|
||||||
unless @params =~ full_valid_syntax
|
unless @params =~ full_valid_syntax
|
||||||
raise SyntaxError.new <<-eos
|
raise ArgumentError.new <<-eos
|
||||||
Invalid syntax for include tag:
|
Invalid syntax for include tag:
|
||||||
|
|
||||||
#{@params}
|
#{@params}
|
||||||
|
|
Loading…
Reference in New Issue