From: Tim Becker Date: 2006-05-24T18:26:32+09:00 Subject: Re: find some error with exception What are you trying to accomplish? Infinite recursion is generally not a really good idea unless you want to cripple your machine temporarily. -tim On 5/24/06, Searchsa Faust wrote: > run following script > --------------------------------------------- > def foo(i) > foo(i+1) > end > def main1 > begin > foo(1) > rescue > puts $!.backtrace.join("\n") > end > end > > def main2 > begin > foo(1) > rescue > puts $!.backtrace.join("\n") > end > end > > main1 > main2 > ---------------------------------------------- > this will has to "stack too deep" error at DIFFERENT line of the script > but the result will be > =========================== > mm.rb:2:in `foo' > mm.rb:2:in `foo' > mm.rb:8:in `main1' > mm.rb:22 > mm.rb:2:in `foo' > mm.rb:2:in `foo' > mm.rb:8:in `main1' > mm.rb:22 > =========================== > both show the 1st error position > this error should be correct > > -- > Posted via http://www.ruby-forum.com/. > >