Every now and then some JavaScript function I'm working on would just quit quietly, without anything indicating in any way that something out of the ordinary has occurred.
This is driving me insane. Surely there must be a way to turn on some sort of "I'm a developer" flag so that things like this will throw a big fat "Something's Wrong!" message?
Example function:
window.setTimeout(function() {
alert('Entered!');
foo;
alert('Exited!');
}, 300);
On my Firefox 6, this shows only the first alert. The Error Log remains completely empty. Can I get a more useful behaviour out of Firefox?
You could try using a try -> catch around bits of the code to see what crashes?
Take a look at this link: http://www.w3schools.com/js/js_try_catch.asp
For example; you can have an alert pop up with the error description.
I suspect that the issue might be this one: https://developer.mozilla.org/en/Exception_logging_in_JavaScript. The new logic that decides which exceptions need to be displayed does have some flaws (particularly when extensions are involved).
You can go to about:config
and create a boolean preference dom.report_all_js_exceptions
. This will make sure that a whole lot more exceptions will show up in Error Console - probably more than you would like to see.
Edit: There is also an issue that causes Adblock Plus to swallow some errors: bug 653533. I'm not sure whether it is covered by the pref I mentioned above.
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