Quoting Steve <[email protected]>:
>
> Hi,
>
> I am trying to debug another problem that occurs when starting the web
> server (either Mongrel or Webrick). The error message it gives me is
> useless, because it hides "...22 levels...". Unfortunatly, the first
> few lines are inside of active scaffold, and the last few are inside
> of the server, leaving me with nothing to debug. How do I view all
> lines of this stack trace? I checked the logs, nothing. I tried
> starting the server in debug mode and this fails because I am using
> Windows.
>
Google is your friend, search "full stack backtrace in Ruby", 1st result,
follow forum link to first reply:
From: Brian Candler <B.Candler pobox.com>
Date: Sun, 10 Oct 2004 20:12:29 +0900
References: 115962
In-reply-to: 115962
On Sun, Oct 10, 2004 at 08:02:20PM +0900, Alexey Verkhovsky wrote:
> Below is a typical Rails exception thrown from within functional tests.
> The interesting part of this exception (test and application code) is
> precisely within "... 18 levels..." that are hidden by the interpreter.
>
> Is there any good way to convince Ruby to print full stack trace?
I had the same issue a couple of years ago, and I ended up grepping through
the interpreter C source for the string "levels..." to find it.
Doing so again... it looks like these are hard-coded constants in eval.c
#define TRACE_HEAD 8
#define TRACE_TAIL 5
So you can change these (and recompile ruby). But I think what I did in the
end was just wrap the code with my own exception catcher, since the full
backtrace array is available to you:
def foo(y)
raise "hell" if y <= 0
foo(y-1)
end
begin
foo(75)
rescue Exception => e
puts "Exception: #{e.class}: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
exit 1
end
Regards,
Brian.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---