]> source.dussan.org Git - redmine.git/commitdiff
Merged r8112 from trunk (#9748).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 10 Dec 2011 12:08:55 +0000 (12:08 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 10 Dec 2011 12:08:55 +0000 (12:08 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.3-stable@8160 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/configuration.rb

index 4257861c3efd6411c845c924f5f4a5e83da897ab..bd4696bd289dd95de58f1f0041e49e9187f9cc85 100644 (file)
@@ -79,7 +79,13 @@ module Redmine
       private
 
       def load_from_yaml(filename, env)
-        yaml = YAML::load_file(filename)
+        yaml = nil
+        begin
+          yaml = YAML::load_file(filename)
+        rescue ArgumentError
+          $stderr.puts "Your Redmine configuration file located at #{filename} is not a valid YAML file and could not be loaded."
+          exit 1
+        end
         conf = {}
         if yaml.is_a?(Hash)
           if yaml['default']
@@ -89,7 +95,7 @@ module Redmine
             conf.merge!(yaml[env])
           end
         else
-          $stderr.puts "#{filename} is not a valid Redmine configuration file"
+          $stderr.puts "Your Redmine configuration file located at #{filename} is not a valid Redmine configuration file."
           exit 1
         end
         conf