Common theme: Framework stacktrace vomit is rough

Unhelpful error from `rails test:system` brought this to mind, but there have been a few other topics in this forum that brought up “this stacktrace is too long / not helpful.”

There was also a comment that brought up that many folks mis-attribute errors to Bootsnap because it’s in nearly every stacktrace and they need someone to blame.

I’ve noticed a number of newbies over the years have emotional responses to stacktrace vomit. Long weird stacktraces full of framework details can be really scary! When I was first learning Rails (back in 2008, oh god) something similar made me put the framework down for a few months because I felt so defeated.

Possible solutions:

  • more aggressive default stacktrace cleaning?
  • more affordances for flipping between “focused” and “verbose” stacktraces?
  • ???
3 Likes

Heh, come to think of it, my newbie did indeed mis-attribute an error to bootsnap for this very reason.

Maybe add affordances such as:

Rails only: list only traces from rails framework

My application: list only traces from my rails app

Librairies: list only traces from non rails librairies

All: the complete stack trace

Could help filter long stack traces.

1 Like

I’m a big fan of backtrace cleaning! I don’t think we’ve upgraded our standard backtrace cleaning to account for neither spring nor bootstrap. We totally should!

2 Likes

We have a complete API to do this:

Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }

But we haven’t updated the default silencers in a long time.

2 Likes