@@ -79,7 +79,13 module Redmine | |||||
79 | private |
|
79 | private | |
80 |
|
80 | |||
81 | def load_from_yaml(filename, env) |
|
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 | conf = {} |
|
89 | conf = {} | |
84 | if yaml.is_a?(Hash) |
|
90 | if yaml.is_a?(Hash) | |
85 | if yaml['default'] |
|
91 | if yaml['default'] | |
@@ -89,7 +95,7 module Redmine | |||||
89 | conf.merge!(yaml[env]) |
|
95 | conf.merge!(yaml[env]) | |
90 | end |
|
96 | end | |
91 | else |
|
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 | exit 1 |
|
99 | exit 1 | |
94 | end |
|
100 | end | |
95 | conf |
|
101 | conf |
General Comments 0
You need to be logged in to leave comments.
Login now