Error Console

The Error Console is a tool available in most Mozilla-based applications that is used for reporting errors in the application chrome and in web pages user opens. It reports JavaScript-related errors and warnings, CSS errors and arbitrary messages from chrome code.  In Firefox, the Error Console can be opened from the tools menu or by Ctrl-Shift-J.

Gecko 2.0 note
(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

The Error Console is disabled by default starting in Firefox 4. You can re-enable it by changing the devtools.errorconsole.enabled preference to true and restarting the browser.

For information about what JavaScript exceptions get logged into the Error Console, and how to make all exceptions get logged, read the article Exception logging in JavaScript. See Setting up extension development environment#Development preferences for the preferences you should set if you want to see errors from Firefox and extensions in the Error console.

Before Gecko 1.8.1 (Firefox 2), it was called JavaScript Console (see bug 265871 ).

Types of errors

Error
usually a syntax error that prevents the program from compiling.
Warning
usually lets the program compile but warns of bad coding and suggests design flaws.
Message
very similar to warning, used very rarely.

Manipulating data displayed in Error Console

Information displayed in Error Console can be accessed and manipulated through the Console service.

Extensions can write to the Error Console from JavaScript using  Components.utils.reportError, or if you're fine with logging to the OS-provided console, dump().

To bring up Error Console from within a browser or mail window, use the function toJavaScriptConsole().

Alternatives

Console2
This extension provides a replacement for Error Console, fixing many of its bugs and implementing long-wanted enhancement requests.
Firebug
The extension for Firefox also integrates the Error Console with various improvements.

Related Topics

JavaScript, CSS, Web Development

 

Tags (7)

Edit tags

Attachments (0)

 

Attach file