Re: [Rails-core] Need help with writing Patch for Issue #8143: Obscure Error with invalid YAML in database.yml

39 views
Skip to first unread message

Pedro Nascimento

unread,
Nov 19, 2012, 5:01:53 PM11/19/12
to rubyonra...@googlegroups.com
You are missing quotes around "config/database".


On Sun, Nov 18, 2012 at 8:41 PM, Gaurish Sharma <con...@gaurishsharma.com> wrote:
I am trying to write a patch to improve the following Obscure error message:

`parse': (<unknown>): mapping values are not allowed in this context at line 18 column 11 (Psych::SyntaxError)


the idea is the a error message should atleast inform in which file the error is, so we may fix it but currently that doesn't happen. so I with my rudimentary rails skills wrote the following script that correctly raises the error:
https://gist.github.com/4107885

But when I tried to apply same technique of rescuing Psych::SyntaxError in rails(https://gist.github.com/4107839), it didn't work. it generates the following error:
railties-3.2.8/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined local variable or method `config' for #<Rails::Application::Configuration:0x00000002dec130> (NameError)

Need suggestions on how to handle this error & print an user-friendly error message.

Issue: https://github.com/rails/rails/issues/8143
Test Script: https://gist.github.com/4107885
Rails change: https://gist.github.com/4107839


Regards,
Gaurish Sharma

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/GhUqAYdk_vEJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

Gaurish Sharma

unread,
Nov 20, 2012, 10:06:30 AM11/20/12
to rubyonra...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages