diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-08 19:06:48 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-08 19:06:48 +0000 |
commit | 9f5eb591131e3ecfa8f47b8ff3509f766a156e48 (patch) | |
tree | b824e03d9af3cd5de78951e80ee8483427274b16 /lib | |
parent | 84d380c6772dadef67e8b513c030ae7cd30d985b (diff) | |
download | redmine-9f5eb591131e3ecfa8f47b8ff3509f766a156e48.tar.gz redmine-9f5eb591131e3ecfa8f47b8ff3509f766a156e48.zip |
Code cleanup.
git-svn-id: http://svn.redmine.org/redmine/trunk@13578 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/configuration.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/redmine/configuration.rb b/lib/redmine/configuration.rb index 77bdd8fd0..9b4ed1dd3 100644 --- a/lib/redmine/configuration.rb +++ b/lib/redmine/configuration.rb @@ -85,11 +85,9 @@ module Redmine begin yaml = YAML::load(ERB.new(File.read(filename)).result) rescue ArgumentError - $stderr.puts "Your Redmine configuration file located at #{filename} is not a valid YAML file and could not be loaded." - exit 1 + abort "Your Redmine configuration file located at #{filename} is not a valid YAML file and could not be loaded." rescue SyntaxError => e - $stderr.puts "A syntax error occurred when parsing your Redmine configuration file located at #{filename} with ERB:\n#{e.message}" - exit 1 + abort "A syntax error occurred when parsing your Redmine configuration file located at #{filename} with ERB:\n#{e.message}" end conf = {} if yaml.is_a?(Hash) @@ -100,8 +98,7 @@ module Redmine conf.merge!(yaml[env]) end else - $stderr.puts "Your Redmine configuration file located at #{filename} is not a valid Redmine configuration file." - exit 1 + abort "Your Redmine configuration file located at #{filename} is not a valid Redmine configuration file." end conf end @@ -121,8 +118,7 @@ module Redmine begin Regexp.new value.to_s.strip rescue => e - $stderr.puts "Invalid regular expression set as #{name} setting in your Redmine configuration file:\n#{e.message}" - exit 1 + abort "Invalid regular expression set as #{name} setting in your Redmine configuration file:\n#{e.message}" end end end |