I have noticed that even with "show stack trace with errors" enabled from the drop down, only errors that occur seem to have traces, but when I do: throw new Error('foo');
I do not see any stack trace for it even though it seems to appear in the console exactly the same way as other errors that occur such as iDoNotExist()
.
Is there something I am missing?
It also seems that I get the stack trace for calling console.error('foo');
. Odd.
It should be noted that stack traces do occur on Webkit Inspector and Opera when doing throw new Error('foo');
.
Use the console. trace() method to get the stack trace from an error. The console. trace() method outputs the stack trace and shows the call path taken to reach the point at which the method was called.
Stack trace error is a generic term frequently associated with long error messages. The stack trace information identifies where in the program the error occurs and is helpful to programmers. For users, the long stack track information may not be very useful for troubleshooting web errors.
For others landing here :
The issue for me was showStackTrace
is set to false by default for Firebug.
Here's how to enable it :
Goto about:config
in Firefox
Change the value of the preference extensions.firebug.showStackTrace
from false
to true
(Double-click toggles the value).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With