From 9f5eb591131e3ecfa8f47b8ff3509f766a156e48 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 8 Nov 2014 19:06:48 +0000 Subject: Code cleanup. git-svn-id: http://svn.redmine.org/redmine/trunk@13578 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/configuration.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3