Firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting:
- Any methods on interfaces annotated with the
[function]attribute in IDL (see, for example,
nsIDomEventListener) that throw exceptions always report those exceptions into the Error Console.
- Any exceptions that are generated by XPConnect -- that is, those exceptions whose result codes are defined in nsIXPConnect.idl -- are always logged into the Error Console.
QueryInterface()method on the
GetInterface()method on the
That last point deserves clarification. Consider this call chain:
There are two ways you can accomplish this.
First, you can set the boolean preference
dom.report_all_js_exceptions. If this preference is
true, all exceptions from inner frames will be logged.
Alternatively, you can set the environment variable
MOZ_REPORT_ALL_JS_EXCEPTIONS. It doesn't matter what value you set this to (it can even be 0). If the variable exists, all exceptions from inner frames will be reported.