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

Print backtrace information #1424

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Conversation

miry
Copy link
Contributor

@miry miry commented Mar 1, 2023

Motivation

Tapioca does not show the place where the error happen,
when it tries to load rails application.

Current solution:

Loading Rails application... Tapioca attempted to load the Rails application after encountering a `config/application.rb` file, but it failed. If your application uses Rails please ensure it can be loaded correctly before generating RBIs.
undefined method `active_record' for ...
Continuing RBI generation without loading the Rails application.

Proposed:

Loading Rails application... 
Tapioca attempted to load the Rails application after encountering a `config/application.rb` file, but it failed. If your application uses Rails please ensure it can be loaded correctly before generating RBIs.
undefined method `active_record' for ...
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.2/lib/rails/railtie/configuration.rb:96:in `method_missing'

Implementation

Add backtrace output. But it would be nice to show backtrace only when Verbose mode enabled.

@miry miry self-assigned this Mar 1, 2023
@miry miry force-pushed the print-backtrace-on-rails-loading-error branch 2 times, most recently from 77f4052 to 441853a Compare March 1, 2023 12:07
@miry miry force-pushed the print-backtrace-on-rails-loading-error branch from 441853a to a606aa3 Compare March 1, 2023 13:47
@miry miry marked this pull request as ready for review March 1, 2023 14:01
@miry miry requested a review from a team as a code owner March 1, 2023 14:01
Copy link
Contributor

@KaanOzkan KaanOzkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally okay with having this enabled by default.

@miry miry merged commit 26c8830 into main Mar 6, 2023
@miry miry deleted the print-backtrace-on-rails-loading-error branch March 6, 2023 07:12
@egiurleo egiurleo added the bugfix label Mar 9, 2023
@shopify-shipit shopify-shipit bot temporarily deployed to production March 10, 2023 16:06 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants