Gaurish Sharma
2012-Nov-18 22:41 UTC
Need help with writing Patch for Issue #8143: Obscure Error with invalid YAML in database.yml
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 rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Pedro Nascimento
2012-Nov-19 22:01 UTC
Re: Need help with writing Patch for Issue #8143: Obscure Error with invalid YAML in database.yml
You are missing quotes around "config/database". On Sun, Nov 18, 2012 at 8:41 PM, Gaurish Sharma <contact@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 rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Gaurish Sharma
2012-Nov-20 15:06 UTC
Re: Need help with writing Patch for Issue #8143: Obscure Error with invalid YAML in database.yml
Thanks. Made the changed & my patch is in the core https://github.com/rails/rails/commit/abb38feac84da59f6686d9abcce61d2a9a64efa9 -- 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/-/rDjOiPWK2_YJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.