Using exception.backtrace_locations #42
Replies: 2 comments
-
The backtrace_locations is an array of
|
Beta Was this translation helpful? Give feedback.
-
Also, this is neat: code_ownership/lib/code_ownership/private.rb Lines 61 to 69 in db89885 I went a slightly different route - I hooked into the rails Autoloaders like this. fxn/zeitwerk#215 Perhaps it might be useful? There was an issue with this for me, though. Classes that were embedded in different files (eg: a custom exception class defined in a containing class) weren't picked up without further coding:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All
So I wrote a very similar library for our internal use :) I'm now looking to switch to the
code_ownership
gem instead.code_ownership/lib/code_ownership.rb
Lines 120 to 138 in db89885
I see that code_ownership is using a regex to find the location. I originally did similar. However, I found
exception.backtrace_locations
which meant I didn't need to do so.I prematurely submitted this discussion - so will add a followup as to how I use it shortly.
Beta Was this translation helpful? Give feedback.
All reactions