From: Yehuda Katz Date: 2008-11-24T11:49:35+09:00 Subject: [ruby-core:20064] Re: printing more output on unrescued exceptions ------=_Part_32490_21942455.1227495238606 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline In case this is not already resolved, I'd like to request the removal of ... 19 levels ... in non-rescued Ruby stack traces. Or, at the very least, the ability to turn of the truncation via an option. With more and more Ruby code taking the form of libraries, it is becoming more and more likely that the important stack frame is in the middle, rather than the top or bottom, of the stack. -- Yehuda On Sat, Nov 22, 2008 at 4:08 PM, Roger Pack wrote: > I have been contemplating creating a patch which would make the output > of an uncaught exception contain the one line of code that raised it > [by reading the source file and outputting that line]: > > ex: > > go.rb: > def go > raise 'unhandled' > end > def go2 > go > end > go2 > > > currently: > > $ ruby go.rb > go.rb:2:in `go': unhandled (RuntimeError) > from go.rb:6:in `go2' > from go.rb:9 > > to become > > $ ruby go.rb > go.rb:2:in `go': unhandled (RuntimeError) > raise 'unhandled' > from go.rb:6:in `go2' > from go.rb:9 > > I think it would be possible in certain cases. > Thoughts? > Thanks! > -=R > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 ------=_Part_32490_21942455.1227495238606 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline In case this is not already resolved, I'd like to request the removal of ... 19 levels ... in non-rescued Ruby stack traces. Or, at the very least, the ability to turn of the truncation via an option. With more and more Ruby code taking the form of libraries, it is becoming more and more likely that the important stack frame is in the middle, rather than the top or bottom, of the stack.

-- Yehuda

On Sat, Nov 22, 2008 at 4:08 PM, Roger Pack <rogerpack2005@gmail.com> wrote:
I have been contemplating creating a patch which would make the output
of an uncaught exception contain the one line of code that raised it
[by reading the source file and outputting that line]:

ex:

go.rb:
def go
 raise 'unhandled'
end
def go2
 go
end
go2


currently:

$ ruby go.rb
go.rb:2:in `go': unhandled (RuntimeError)
       from go.rb:6:in `go2'
       from go.rb:9

to become

$ ruby go.rb
go.rb:2:in `go': unhandled (RuntimeError)
          raise 'unhandled'
       from go.rb:6:in `go2'
       from go.rb:9

I think it would be possible in certain cases.
Thoughts?
Thanks!
-=R




--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325
------=_Part_32490_21942455.1227495238606--