Visit Mozilla.org

Error Console

From MDC


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.

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. An easier way to do some logging from JavaScript is 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().

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.

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