-
Notifications
You must be signed in to change notification settings - Fork 136
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
Report Rails load errors and continue generating #1087
Conversation
lib/tapioca/loaders/loader.rb
Outdated
end | ||
|
||
eager_load_rails_app if eager_load | ||
rescue LoadError => e | ||
say("Tapioca attempted to load the Rails application after encountering a `config/application.rb` file," \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not this only happen when the file isn't found? I think that would be the only cause for a LoadError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about catching all kinds of errors and showing them in the output rather than just LoadError
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Modified to rescue StandardError
as well as LoadError
48030f9
to
cd3fd05
Compare
cd3fd05
to
6846710
Compare
@@ -1758,5 +1758,40 @@ def title=(title); end | |||
end | |||
end | |||
end | |||
|
|||
describe "cli::dsl::custom application.rb" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The application.rb
change was leaking to other tests so I moved it to a new top level describe
block.
Other solutions could be changing this to use before_each
or to write the original application.rb
back at the end.
Report Rails load errors and continue generating
Report Rails load errors and continue generating
Motivation
Resolves #1080
Implementation
Rescue exceptions thrown during eager loading of the rails application
Tests
Added a test