1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Better Error handling when parsing database.yaml

Provides a better error message incase the database.yaml
has some errors.
This commit is contained in:
Gaurish Sharma 2012-11-20 16:18:28 +05:30
parent 03ef833b80
commit 61425f2c6d

View file

@ -105,6 +105,10 @@ module Rails
def database_configuration
require 'erb'
YAML.load ERB.new(IO.read(paths["config/database"].first)).result
rescue Psych::SyntaxError => e
raise "YAML syntax error occurred while parsing #{paths["config/database"].first}. " \
"Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \
"Error: #{e.message}"
end
def log_level