diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-20 03:48:32 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-20 03:48:32 -0800 |
commit | abb38feac84da59f6686d9abcce61d2a9a64efa9 (patch) | |
tree | 46814a61c60b9f90822728b6628a82eeb148aece /railties | |
parent | 03ef833b804fe17ff834ac957a300d45bbb24fab (diff) | |
parent | 61425f2c6d14fe7151b09ffe5a5353924582e5b0 (diff) | |
download | rails-abb38feac84da59f6686d9abcce61d2a9a64efa9.tar.gz rails-abb38feac84da59f6686d9abcce61d2a9a64efa9.tar.bz2 rails-abb38feac84da59f6686d9abcce61d2a9a64efa9.zip |
Merge pull request #8279 from gaurish/database_error
Improved Error handling when parsing database.yaml, Fixes #8143
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index f97e66985c..89afeaeec5 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -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 |