Forum: Ruby Length of backtrace displayed by ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
934180817a3765d132193a5428f99051?d=identicon&s=25 Sylvain Joyeux (Guest)
on 2006-04-04 17:26
(Received via mailing list)
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
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2006-04-04 17:35
(Received via mailing list)
Hi,

In message "Re: Length of backtrace displayed by ruby"
    on Wed, 5 Apr 2006 00:25:52 +0900, Sylvain Joyeux
<sylvain.joyeux@polytechnique.org> 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.
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-04-04 17:48
(Received via mailing list)
On Wed, 5 Apr 2006, Yukihiro Matsumoto wrote:

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

   Exception.backtrace_display_limit = 42

??

-a
10d4acbfdaccb4eee687a428ca00a5d8?d=identicon&s=25 Jim Weirich (weirich)
on 2006-04-04 19:26
Sylvain Joyeux 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 Weirich
7264fb16beeea92b89bb42023738259d?d=identicon&s=25 Christian Neukirchen (Guest)
on 2006-04-04 23:20
(Received via mailing list)
Yukihiro Matsumoto <matz@ruby-lang.org> writes:

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

How about giving a full backtrace with ruby -d?
Dba0cb4cdad3b8e3b7ed0fddff5d20a5?d=identicon&s=25 Stephen Kellett (Guest)
on 2006-04-05 00:00
(Received via mailing list)
In message <Pine.LNX.4.62.0604040944090.5852@harp.ngdc.noaa.gov>,
ara.t.howard@noaa.gov writes
>On Wed, 5 Apr 2006, Yukihiro Matsumoto 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
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-04-05 00:13
(Received via mailing list)
On Wed, 5 Apr 2006, Stephen Kellett wrote:

> In message <Pine.LNX.4.62.0604040944090.5852@harp.ngdc.noaa.gov>,
> ara.t.howard@noaa.gov writes
>> On Wed, 5 Apr 2006, Yukihiro Matsumoto 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
934180817a3765d132193a5428f99051?d=identicon&s=25 Sylvain Joyeux (Guest)
on 2006-04-05 07:45
(Received via mailing list)
> 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)
Dba0cb4cdad3b8e3b7ed0fddff5d20a5?d=identicon&s=25 Stephen Kellett (Guest)
on 2006-04-05 11:41
(Received via mailing list)
In message <Pine.LNX.4.62.0604041611040.5852@harp.ngdc.noaa.gov>,
ara.t.howard@noaa.gov 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.
This topic is locked and can not be replied to.