@@ -79,7 +79,13 module Redmine | |||
|
79 | 79 | private |
|
80 | 80 | |
|
81 | 81 | def load_from_yaml(filename, env) |
|
82 | yaml = YAML::load_file(filename) | |
|
82 | yaml = nil | |
|
83 | begin | |
|
84 | yaml = YAML::load_file(filename) | |
|
85 | rescue ArgumentError | |
|
86 | $stderr.puts "Your Redmine configuration file located at #{filename} is not a valid YAML file and could not be loaded." | |
|
87 | exit 1 | |
|
88 | end | |
|
83 | 89 | conf = {} |
|
84 | 90 | if yaml.is_a?(Hash) |
|
85 | 91 | if yaml['default'] |
@@ -89,7 +95,7 module Redmine | |||
|
89 | 95 | conf.merge!(yaml[env]) |
|
90 | 96 | end |
|
91 | 97 | else |
|
92 | $stderr.puts "#{filename} is not a valid Redmine configuration file" | |
|
98 | $stderr.puts "Your Redmine configuration file located at #{filename} is not a valid Redmine configuration file." | |
|
93 | 99 | exit 1 |
|
94 | 100 | end |
|
95 | 101 | conf |
General Comments 0
You need to be logged in to leave comments.
Login now