1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

Unhandled exception when a YAML syntax error is detected in configuration.yml (#35421).

Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@21057 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2021-07-01 09:17:53 +00:00
parent 6d3d2b3adb
commit 504e9f3489

View File

@ -93,8 +93,8 @@ module Redmine
yaml = nil
begin
yaml = YAML::load(ERB.new(File.read(filename)).result)
rescue ArgumentError
abort "Your Redmine configuration file located at #{filename} is not a valid YAML file and could not be loaded."
rescue ArgumentError, Psych::SyntaxError => e
abort "Your Redmine configuration file located at #{filename} is not a valid YAML file and could not be loaded:\n#{e.message}"
rescue SyntaxError => e
abort "A syntax error occurred when parsing your Redmine configuration file located at #{filename} with ERB:\n#{e.message}"
end