Hi all,

The Exception#cause 
<https://docs.ruby-lang.org/en/2.5.0/Exception.html#method-i-cause> method 
has been added to Ruby 2.1.0 back in 2013. Since then Rails has adopted it 
to replace the #original_exception method in a few classes such as the 
ActiveSupport::Rescuable, and I believe we could take a step further to 
help debug an app in development. One low-hanging fruit that I see is to 
add the ability to show causes in the DebugExceptions view. I have made a 
proof-of-concept implementation to see if it could be really useful. Here 
is a screenshot of what it looks like:

<https://lh3.googleusercontent.com/-c2fDa8QOD_E/WqH2BseaMwI/AAAAAAAAI7Y/wmsycW0XTZc54oormsA-YESlOswS3PBogCLcBGAs/s1600/ezgif-5-6bb9a21c5b.gif>

The code could be found 
here: 
https://github.com/rails/rails/compare/master...yuki24:show-cause-on-debug-view

Of course, there is going to be more things to take care of, such as 
implementing more frontend features and updating how a TemplateError (which 
already uses #cause) could be shown, but I wanted to get feedback 
(especially on the visual aspect of the PoC) before I invest more time in 
it.

Let me know what you all think.

Thanks,
Yuki

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to