No stack trace for uncaught exception?

195 views
Skip to first unread message

Markus Fischer

unread,
Jan 18, 2007, 4:06:24 AM1/18/07
to Firebug
I'm finding it troublesome to only have the message "uncaught
exception: Not implemented" in the FB console. My code at various
points has "throw 'Not implemented". What can I do to find out which
exact function/method this happened in? Can FB be enhanced to support
such stack traces?

thanks

Markus Fischer

unread,
Jan 18, 2007, 4:06:30 AM1/18/07
to Firebug

d3ik

unread,
Jan 18, 2007, 4:23:56 AM1/18/07
to Firebug
I agree. This relates to my message a couple days ago about throwing
arbitrary objects as exceptions and not getting a stack trace. It
appears you only get a stack trace if you throw the Error object, as
in:

throw new Error('exception message goes here');

I've tried to throw a subclass of Error (where myObject instanceof
Error == true) and still no stack trace. I'll have to dig into the
chrome code a bit more to see how FB determines whether to display a
stack trace (or even if FF makes one available for certain objects).

Markus Fischer

unread,
Jan 18, 2007, 4:42:35 AM1/18/07
to Firebug
Ah, thanks. I found your message but I wasn't quite sure how it
relates. I see now. Is Error cross browser? I've to admin it's the
first time I've read about it (but I'm not a complete JS newby).

John J Barton

unread,
Jan 18, 2007, 12:28:57 PM1/18/07
to Firebug
This particular problem is built into mozilla in that the xpcom
interface
for errors relies on nsIScriptError objects. The Firebug console is
literally a reflection of the xpcom console (nsIConsoleListener) so
if you can't see it in the Javascript console you won't see it in
Firebug's console.

Better support for throw could be added but not through the current
console mechanism.

Reply all
Reply to author
Forward
0 new messages