Home

# Class goog.debug.ErrorReporter

Constructs an error reporter. Internal Use Only. To install an error reporter see the {@see #install} method below.

extends goog.events.EventTarget

Instance Method Summary

`disposeInternal()`

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

    MyClass.prototype.disposeInternal = function() {
    MyClass.superClass_.disposeInternal.call(this);
    // Dispose logic for MyClass
    };

| `handleException(?Object e, Object.<string>= opt_context)` Handler for caught exceptions. Sends report to the LoggingServlet and notifies any listeners.
| `protectAdditionalEntryPoint(?Function fn) ⇒ ?Function` Installs exception protection for an entry point function in addition to those that are protected by default. Has no effect in IE because window.onerror is used for reporting exceptions in that case.
| `sendErrorReport(string message, string fileName, number line, string= opt_trace, Object.<string>= opt_context)` Sends an error report to the logging URL. This will not consult the context provider, the report will be sent exactly as specified.
| `setLoggingHeaders((Object|goog.structs.Map|null) loggingHeaders)` Add headers to the logging url.
| `setXhrSender(function (string, string, string, (Object|goog.structs.Map|null)=): ? xhrSender)` Set the function used to send error reports to the server.
| `setup_()` Sets up the error reporter.

Static Method Summary
| `defaultXhrSender(string uri, string method, string content, (Object|goog.structs.Map|null=) opt_headers)` Default implemntation of XHR sender interface.
| `install(string loggingUrl, function (Error, Object.<string>): ?= opt_contextProvider, boolean= opt_noAutoProtect) ⇒ ?goog.debug.ErrorReporter` Installs an error reporter to catch all JavaScript errors raised.