-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rails 6 - error page logs no information if a file misreports line counts #36719
Comments
Fixed by #36532 |
I can confirm the more general issue of some exceptions not being logged in the console on development still exists. I've had a couple of issues crop up in the past weeks around In my situation, I was able to step down to https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb#L146 and determine that I've provided a self-tested fix in a PR that I'm about to post that logs the exceptions as one would expect. Hopefully this saves people a lot of time that I've spent tracking down silent errors. |
I've just run into the same issue as @AnomalousBit above with a new Rails 6 install, the fix suggested in #38820 (comment) worked for me. |
@bobwhitelock God this was hard to figure out. Thanks everybody in this thread and thanks for the link to the other issue |
Certain features of slim, such as the
include
directive, can cause files to misreport line counts. This leads to the problem as follows, which has cost me a significant amount of time debugging.Steps to reproduce
rails _6.0.0.rc1_ new myapp6 --skip-javascript
rails s
development.log
.Expected behavior
Rails should at the very least output the exception class and message. While far from ideal of actually displaying an error page with exception information, this is at least debuggable.
This error is correctly logged in a Rails 5.2.3 application initialized with
rails _5.2.3_ new myapp5 --skip-javascript
.Potential fixes
Add
rescue nil
here.rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
Line 151 in 3d2bdc1
If the end index is lower than the start index, return an empty array instead.
rails/actionview/lib/action_view/template/error.rb
Line 94 in 3d2bdc1
System configuration
Rails version: 6.0.0.rc1
Ruby version: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
The text was updated successfully, but these errors were encountered: