Length of backtrace displayed by ruby


#1

Is there a way to remove the maximum backtrace length displayed by the
interpreter when an exception terminates the process ? It makes the
backtrace
totally useless in situations where it is long and the interesting
calls
are in the middle.

Thanks

Sylvain


#2

Hi,

In message “Re: Length of backtrace displayed by ruby”
on Wed, 5 Apr 2006 00:25:52 +0900, Sylvain J.
removed_email_address@domain.invalid writes:

|Is there a way to remove the maximum backtrace length displayed by the
|interpreter when an exception terminates the process ? It makes the backtrace
|totally useless in situations where it is long and the interesting calls
|are in the middle.

Not yet. Do you (or anybody else) have any good API suggestion?

						matz.

#3

On Wed, 5 Apr 2006, Yukihiro M. wrote:

Not yet. Do you (or anybody else) have any good API suggestion?

  					matz.

Exception.backtrace_display_limit = 42

??

-a


#4

Yukihiro M. removed_email_address@domain.invalid writes:

Not yet. Do you (or anybody else) have any good API suggestion?

  					matz.

How about giving a full backtrace with ruby -d?


#5

In message removed_email_address@domain.invalid,
removed_email_address@domain.invalid writes

On Wed, 5 Apr 2006, Yukihiro M. wrote:

Not yet. Do you (or anybody else) have any good API suggestion?

Exception.backtrace_display_limit = 42

Exception.setFilter(regularExpression)

where the matching items are removed from the backtrace.

Stephen


#6

Sylvain J. wrote:

Is there a way to remove the maximum backtrace length displayed by the
interpreter when an exception terminates the process ? It makes the
backtrace
totally useless in situations where it is long and the interesting
calls
are in the middle.

IIRC, this only happens when the exception is handled by the top level
interpreter. If you catch the exception yourself at the top level you
can print out whatever you want, including the full stack trace.


– Jim W.


#7

IIRC, this only happens when the exception is handled by the top level
interpreter. If you catch the exception yourself at the top level you
can print out whatever you want, including the full stack trace.
Yes, that’s what I did as a workaround. But you have to do it for every
thread and every fork (which in my case is 4 different places)


#8

On Wed, 5 Apr 2006, Stephen K. wrote:

In message removed_email_address@domain.invalid,
removed_email_address@domain.invalid writes

On Wed, 5 Apr 2006, Yukihiro M. wrote:

Not yet. Do you (or anybody else) have any good API suggestion?

Exception.backtrace_display_limit = 42

Exception.setFilter(regularExpression)

where the matching items are removed from the backtrace.

what would be matched?

e.to_s, e.message.to_s, or e.backtrace.any?{|b|}

regards.

-a


#9

In message removed_email_address@domain.invalid,
removed_email_address@domain.invalid writes

Exception.setFilter(regularExpression)

where the matching items are removed from the backtrace.

what would be matched?

e.to_s, e.message.to_s, or e.backtrace.any?{|b|}

Class and method name was what I was thinking of.