summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-07-01 09:17:53 +0000
committerGo MAEDA <maeda@farend.jp>2021-07-01 09:17:53 +0000
commit504e9f348992bc2d3e54b360b1659829886eb101 (patch)
treebeec1142974b37013eea82dd9bacd7ee8fa76da8 /lib/redmine
parent6d3d2b3adb985cf716eedd2e8b495f548b937624 (diff)
downloadredmine-504e9f348992bc2d3e54b360b1659829886eb101.tar.gz
redmine-504e9f348992bc2d3e54b360b1659829886eb101.zip
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
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/configuration.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/configuration.rb b/lib/redmine/configuration.rb
index d2d27f775..883dc8497 100644
--- a/lib/redmine/configuration.rb
+++ b/lib/redmine/configuration.rb
@@ -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