Is there any way to add custom lines to backtraces?
I saw this one:
http://4thmouse.com/index.php/2011/02/02/improving-your-exception-backtrace-with-ruby-dsls/
It's pretty close but it looks like it might be pretty fragile too.
Thanks
Samuel
Is there any way to add custom lines to backtraces?
I saw this one:
http://4thmouse.com/index.php/2011/02/02/improving-your-exception-backtrace-with-ruby-dsls/
It's pretty close but it looks like it might be pretty fragile too.
Thanks
Samuel
You can use the backtrace
<Class: Exception (Ruby 2.3.0); and
set_backtrace
<Class: Exception (Ruby 2.3.0);
methods on Exception to modify the lines however you like. That's
essentially what your linked article does.
Also note that raise
<Module: Kernel (Ruby 2.3.0); lets you add
your own callback information, too.
These will always be relatively fragile, because there's no hard and fast
rule about what will appear in any particular exception's backtrace array,
or what the individual lines will say.
Cheers
On 10 March 2016 at 12:12, Samuel Williams <space.ship.traveller@gmail.com> wrote:
Is there any way to add custom lines to backtraces?
I saw this one:
http://4thmouse.com/index.php/2011/02/02/improving-your-exception-backtrace-with-ruby-dsls/It's pretty close but it looks like it might be pretty fragile too.
Thanks
Samuel
--
Matthew Kerwin
http://matthew.kerwin.net.au/