How to use the chrome.Cu.reportError function in chrome

To help you get started, we’ve selected a few chrome examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / activity-stream / addon / ActivityStreams.js View on Github external
send(action, worker, skipMasterStore) {
    // if the function is async, the worker might not be there yet, or might have already disappeared
    try {
      if (!skipMasterStore) {
        this._store.dispatch(action);
      }
      worker.port.emit(ADDON_TO_CONTENT, action);
      this._perfMeter.log(worker.tab, action.type);
    } catch (err) {
      this._pagemod.removeWorker(worker);
      Cu.reportError(err);
    }
  },
github mozilla / memchaser / extension / lib / garbage-collector.js View on Github external
observe: function CollectorObserver_observe(aSubject, aTopic, aData) {
    let data = { };
    let type = aTopic;

    try {
      data = JSON.parse(aData);
    } catch (e) {
      Cu.reportError("Failure parsing JSON data: " + aData);
    }

    // Use milliseconds instead of microseconds for the timestamp
    if ('timestamp' in data)
      data['timestamp'] = Math.round(data['timestamp'] / 1000);

    emit(reporter, type, data);
  }
}
github mozilla / activity-stream / addon / PreviewProvider.js View on Github external
}).catch(err => {
      // TODO: add more exception handling code, e.g. sending exception report
      Cu.reportError(err);
    });
  },
github firebug / har-export-trigger / lib / trigger-toolbox-overlay.js View on Github external
onReady: function(options) {
    ToolboxOverlay.prototype.onReady.apply(this, arguments);

    Trace.sysout("TriggerToolboxOverlay.onReady;", options);

    // Platform support is needed here.
    // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1184889
    if (typeof getHarOverlay != "function") {
      Cu.reportError("Platform support needed, see Bug: " +
        "https://bugzilla.mozilla.org/show_bug.cgi?id=1184889");
      return;
    }

    // Call make remote to make sure the target.client exists.
    let target = this.toolbox.target;
    target.makeRemote().then(() => {
      // The 'devtools.netmonitor.har.enableAutoExportToFile' option doesn't
      // have to be set if users don't want to auto export to file after
      // every page load.
      // But, if users want to use HAR content API to trigger HAR export
      // when needed, HAR automation needs to be activated. Let's do it now
      // if 'extensions.netmonitor.har.enableAutomation' preference is true.
      if (prefs.enableAutomation && !this.automation) {
        Trace.sysout("TriggerToolboxOverlay.onReady; Init automation");
github palant / searchlinkfix / testhelper / index.js View on Github external
onStateChange: function(browser, webProgress, request, flags, status)
  {
    if (!(flags & Ci.nsIWebProgressListener.STATE_IS_WINDOW))
      return;
    if (!(flags & Ci.nsIWebProgressListener.STATE_START) && !(flags & Ci.nsIWebProgressListener.STATE_REDIRECTING))
      return;
    if (request instanceof Ci.nsIChannel)
      Cu.reportError("[testhelper] Loading: " + request.URI.spec);
  }
};
github firebug / devtools-extension-examples / WebSockets / lib / wsm-actor.js View on Github external
removeFrameListener: function() {
    var innerId = getInnerId(this.parent.window);
    try {
      webSocketService.removeListener(innerId, this);
    } catch (err) {
      Cu.reportError("WsmActor.removeFrameListener; ERROR " + err, err);
    }
  },
});
github firebug / websocket-monitor / lib / wsm-actor.js View on Github external
removeFrameListener: function() {
    var innerId = getInnerId(this.parent.window);
    try {
      webSocketEventService.removeListener(innerId, this);
    } catch (err) {
      Cu.reportError("WsmActor.removeFrameListener; ERROR " + err, err);
    }
  },
});
github mozilla / interest-dashboard / lib / streams / core.js View on Github external
error => {
      Cu.reportError(error);
      deferred.reject(error);
    });
    return deferred.promise;
github mozilla / fx-share-addon / lib / email / smtp.js View on Github external
SslSmtpClient.prototype.internalNextCommand = function() {
    if(this.pending_command)
        return;
    if(this.commands.length == 0)
        return;
    var cmd = this.commands.shift();
    var data_bit = cmd["command"] + "\r\n";
    if(this.logging)
        Cu.reportError("SMTP OUT @ " + new Date() + ":\n" + data_bit);
    this.socket.write(data_bit);
    this.pending_command = cmd;
};
SslSmtpClient.prototype.disconnect = function() {
github firebug / firebug.next / lib / console / console-proxy.js View on Github external
_onAttachConsole: function WCCP__onAttachConsole(aResponse, aWebConsoleClient)
  {
    if (aResponse.error) {
      Cu.reportError("attachConsole failed: " + aResponse.error + " " +
                     aResponse.message);
      this._connectDefer.reject(aResponse);
      return;
    }

    this.webConsoleClient = aWebConsoleClient;

    this._hasNativeConsoleAPI = aResponse.nativeConsoleAPI;

    let msgs = ["PageError", "ConsoleAPI"];
    this.webConsoleClient.getCachedMessages(msgs, this._onCachedMessages);

    this.owner._updateReflowActivityListener();
  },

chrome

Open chrome in shell

ISC
Latest version published 9 years ago

Package Health Score

42 / 100
Full package analysis

Popular chrome functions