autoprint of exception backtrace

M

mortee

How can I modify how much of the exception backtrace gets printed by
ruby for an unhandled exception? When an exception is raised deep in the
caller stack, I see the bottom of the stack printed, then something like

... 11 levels...

And then the top of the stack. What do I do if I'm interested in the
omitted part?

I'd prefer to do it wihout having to catch the exception myself, rather
have just this little behaviour modified.

thx
mortee
 
P

Peter Schrammel

Hi mortee,

I had a look at the sources but all there is:
#define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
#define TRACE_HEAD 8
#define TRACE_TAIL 5
in eval.c

it seems to me, that the number of outputlines is hardcoded. So only
recompile helps. I tested it (changed the values to 20) and it works.
Can somebody with more core-dev experience acknowledge this? It would be
cool if one could change this somehow (without recompile).

if you can use irb you might be luckier:
--back-trace-limit n
displays backtrace top n and tail n. The default value is 16.


Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top