Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application_controller / application dependency check issue #5

Open
rapind opened this issue Oct 2, 2009 · 1 comment
Open

application_controller / application dependency check issue #5

rapind opened this issue Oct 2, 2009 · 1 comment

Comments

@rapind
Copy link

rapind commented Oct 2, 2009

in /lib/resource_controller.rb
Lines:
begin
require_dependency 'application_controller'
rescue LoadError => e
require_dependency 'application'
end

The problem with this sort of check is that if you have a load error that has nothing to do with the application_controller v.s. application renamed dependency (say you defined a helper wrong etc.), then the true error is hidden and you get a no such file to load - application error instead.

To reproduce, use the latest rc as a plugin or a gem, create a model, controller, helper, etc. file and declare it wrong. I.e. post_help.rb but declared as "module OopsHelper". This is a pretty contrived example, but the point is, the way rc uses rescue on LoadError means your app hides any meaningful error messages that may occur on load, forcing you to edit rc and comment out those lines to figure out what the actual error was.

@potomak
Copy link

potomak commented May 12, 2010

Same for me...
Thanks to @rapind for his explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants