Bug 1803332 - Port bug 1801092 to Thunderbird - Add an ESLint rule to disallow single-argument use of Cu.reportError. rs=eslint DONTBUILD

This commit is contained in:
Magnus Melin 2022-11-30 21:43:13 +11:00
Родитель 70cdc7d759
Коммит ce399a22e9
135 изменённых файлов: 330 добавлений и 332 удалений

Просмотреть файл

@ -413,7 +413,7 @@ function initHomeCalendar() {
try {
gDataMigrator.checkAndMigrate();
} catch (e) {
Cu.reportError("Migrator error: " + e);
console.error("Migrator error: " + e);
}
}

Просмотреть файл

@ -47,7 +47,7 @@ var gCalendarStatusFeedback = {
startMeteors(aProgressMode, aCalendarCount) {
if (aProgressMode != Ci.calIStatusObserver.NO_PROGRESS) {
if (!this.mInitialized) {
Cu.reportError("StatusObserver has not been initialized!");
console.error("StatusObserver has not been initialized!");
return;
}
this.mCalendars = {};

Просмотреть файл

@ -396,7 +396,7 @@ function onLoad() {
rule = cal.wrapInstance(rules[0], Ci.calIRecurrenceRule);
}
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
}
if (!rule) {
@ -1139,7 +1139,7 @@ function changeOrderForElements(aPropKey, aPropParams) {
"erties has incorrect number of params. Expected " +
aPropParams.length +
" params.";
Cu.reportError(msg + " " + ex);
console.error(msg + " " + ex);
return;
}

Просмотреть файл

@ -501,7 +501,7 @@ var calImipBar = {
try {
aActionFunc(opListener, aParticipantStatus, aExtResponse);
} catch (exc) {
Cu.reportError(exc);
console.error(exc);
}
return true;
}

Просмотреть файл

@ -181,7 +181,7 @@ async function putItemsIntoCal(destCal, aItems, aListener) {
if (e == Ci.calIErrors.DUPLICATE_ID) {
await callListener("onDuplicate", item, e);
} else {
Cu.reportError(e);
console.error(e);
await callListener("onError", item, e);
}
}

Просмотреть файл

@ -413,7 +413,7 @@ var TodayPane = {
// As there's no known plausible explanation, just catch the exception and carry on.
document.getElementById("today-minimonth").value = cal.dtz.dateTimeToJsDate(this.start);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
}
this.updatePeriod();

Просмотреть файл

@ -1113,7 +1113,7 @@ Extractor.prototype = {
for (let idx = vals.length - 1; idx >= 0; idx--) {
if (vals[idx].trim() == "") {
vals.splice(idx, 1);
Cu.reportError("[calExtract] Faulty extraction pattern " + value + " for " + name);
console.error("[calExtract] Faulty extraction pattern " + value + " for " + name);
}
}
@ -1163,7 +1163,7 @@ Extractor.prototype = {
for (let idx = vals.length - 1; idx >= 0; idx--) {
if (vals[idx].trim() == "") {
vals.splice(idx, 1);
Cu.reportError("[calExtract] Faulty extraction pattern " + value + " for " + name);
console.error("[calExtract] Faulty extraction pattern " + value + " for " + name);
}
}
@ -1225,7 +1225,7 @@ Extractor.prototype = {
// correctness checking
for (i = 1; i <= count; i++) {
if (positions[i] === undefined) {
Cu.reportError(
console.error(
"[calExtract] Faulty extraction pattern " + name + ", missing parameter #" + i
);
}

Просмотреть файл

@ -124,7 +124,7 @@ var cal = {
let rescode = aCritical === true ? Cr.NS_ERROR_UNEXPECTED : aCritical;
throw new Components.Exception(string, rescode);
} else {
Cu.reportError(string);
console.error(string);
}
},

Просмотреть файл

@ -38,7 +38,7 @@ class ListenerSet extends Set {
try {
observer[func](...args);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
}
}

Просмотреть файл

@ -35,7 +35,7 @@ function _getString(aComponent, aBundleName, aStringName, aParams = []) {
return props.GetStringFromName(aStringName);
} catch (ex) {
let msg = `Failed to read '${aStringName}' from ${propName}.`;
Cu.reportError(`${msg} Error: ${ex}`);
console.error(`${msg} Error: ${ex}`);
return aStringName;
}
}

Просмотреть файл

@ -759,7 +759,7 @@ CalAlarmService.prototype = {
this.removeAlarmsForItem(item);
this.addAlarmsForItem(item);
} catch (e) {
Cu.reportError("Promise was rejected: " + e);
console.error("Promise was rejected: " + e);
this.mLoadedCalendars[calendar.id] = true;
this.mObservers.notify("onAlarmsLoaded", [calendar]);
reject(e);

Просмотреть файл

@ -846,7 +846,7 @@ calMgrCalendarObserver.prototype = {
// Log warnings in error console.
// Report serious errors in both error console and in prompt window.
if (aErrNo == calIErrors.MODIFICATION_FAILED) {
Cu.reportError(summary);
console.error(summary);
this.announceParamBlock(paramBlock);
} else {
cal.WARN(summary);
@ -867,7 +867,7 @@ calMgrCalendarObserver.prototype = {
return !equalMessage(msg, paramBlock);
});
} catch (e) {
Cu.reportError(e);
console.error(e);
}
};

Просмотреть файл

@ -22,7 +22,7 @@ function launchBrowser(url, event) {
// XXX: We likely will want to do this using nsIURLs in the future to
// prevent sneaky nasty escaping issues, but this is fine for now.
if (!/^https?:/i.test(url) && !/^mid:/i.test(url)) {
Cu.reportError(
console.error(
"launchBrowser: Invalid URL provided: " + url + " Only http(s):// and mid:// URLs are valid."
);
return;

Просмотреть файл

@ -219,7 +219,7 @@ calCachedCalendar.prototype = {
this.mCachedCalendar = cachedCalendar;
}
} catch (exc) {
Cu.reportError(exc);
console.error(exc);
}
},
@ -275,7 +275,7 @@ calCachedCalendar.prototype = {
mPendingSync: null,
async synchronize() {
if (!this.mPendingSync) {
this.mPendingSync = this._doSynchronize().catch(Cu.reportError);
this.mPendingSync = this._doSynchronize().catch(console.error);
}
return this.mPendingSync;
},

Просмотреть файл

@ -309,7 +309,7 @@ function monkeyPatch(obj, x, func) {
try {
return func.apply(obj, args);
} catch (e) {
Cu.reportError(e);
console.error(e);
throw e;
}
};

Просмотреть файл

@ -445,7 +445,7 @@ imAccount.prototype = {
_reconnectTimer: null,
_startReconnectTimer() {
if (Services.io.offline) {
Cu.reportError("_startReconnectTimer called while offline");
console.error("_startReconnectTimer called while offline");
return;
}
@ -714,7 +714,7 @@ imAccount.prototype = {
try {
this.connect();
} catch (e) {
Cu.reportError(e);
console.error(e);
this._finishedAutoLogin();
}
},
@ -989,7 +989,7 @@ AccountsService.prototype = {
}
new imAccount(account);
} catch (e) {
Cu.reportError(e);
console.error(e);
dump(e + " " + e.toSource() + "\n");
}
}
@ -1186,7 +1186,7 @@ AccountsService.prototype = {
throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
}
if (prpl.accountExists(aName)) {
Cu.reportError("Attempted to create a duplicate account!");
console.error("Attempted to create a duplicate account!");
throw Components.Exception("", Cr.NS_ERROR_ALREADY_INITIALIZED);
}

Просмотреть файл

@ -1366,7 +1366,7 @@ Buddy.prototype = {
}
this._contact._observe(aSubject, aTopic, aData);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},
_notifyObservers(aTopic, aData) {
@ -1518,7 +1518,7 @@ ContactsService.prototype = {
let tagId = statement.getInt32(2);
if (!BuddiesById.hasOwnProperty(buddyId)) {
Cu.reportError(
console.error(
"Corrupted database: account_buddy entry for account " +
accountId +
" and tag " +
@ -1531,7 +1531,7 @@ ContactsService.prototype = {
let buddy = BuddiesById[buddyId];
if (buddy._hasAccountBuddy(accountId, tagId)) {
Cu.reportError(
console.error(
"Corrupted database: duplicated account_buddy entry: " +
"account_id = " +
accountId +
@ -1548,7 +1548,7 @@ ContactsService.prototype = {
try {
buddy._addAccount(account.loadBuddy(buddy, tag), tag);
} catch (e) {
Cu.reportError(e);
console.error(e);
dump(e + "\n");
}
}
@ -1651,7 +1651,7 @@ ContactsService.prototype = {
let accountId = account.numericId;
let tagId = aAccountBuddy.tag.id;
if (buddy._hasAccountBuddy(accountId, tagId)) {
Cu.reportError(
console.error(
"Attempting to store a duplicate account buddy " +
normalizedName +
", account id = " +

Просмотреть файл

@ -218,7 +218,7 @@ UserStatus.prototype = {
}
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
this._notifyObservers("user-icon-changed", newName);
@ -383,7 +383,7 @@ CoreService.prototype = {
// This is a real error, the protocol is registered and failed to init.
let error = "failed to create an instance of " + cid + ": " + e;
dump(error + "\n");
Cu.reportError(error);
console.error(error);
}
if (!proto) {
return null;
@ -392,7 +392,7 @@ CoreService.prototype = {
try {
proto.init(aPrplId);
} catch (e) {
Cu.reportError("Could not initialize protocol " + aPrplId + ": " + e);
console.error("Could not initialize protocol " + aPrplId + ": " + e);
return null;
}

Просмотреть файл

@ -229,7 +229,7 @@ function queueLogFileCleanup(path) {
.join("\n");
await IOUtils.writeUTF8(path, cleanedLog);
} catch (error) {
Cu.reportError(
console.error(
"Error cleaning up log file contents for " + path + ": " + error
);
} finally {
@ -268,7 +268,7 @@ function initLogCleanup() {
ChromeUtils.idleDispatch(() => {
let pendingCleanupPaths = JSON.parse(pendingCleanupPathValue) ?? [];
if (!Array.isArray(pendingCleanupPaths)) {
Cu.reportError(
console.error(
"Pending chat log cleanup pref is not a valid array. " +
"Assuming all chat logs are clean."
);
@ -332,7 +332,7 @@ LogWriter.prototype = {
// Catch the error separately so that _initialized will stay rejected if
// writing the header failed.
this._initialized.catch(aError =>
Cu.reportError("Failed to initialize log file:\n" + aError)
console.error("Failed to initialize log file:\n" + aError)
);
},
// We start a new log file in the following cases:
@ -400,7 +400,7 @@ LogWriter.prototype = {
try {
await appendToFile(this.currentPath, lineToWrite);
} catch (error) {
Cu.reportError("Failed to log message:\n" + error);
console.error("Failed to log message:\n" + error);
}
if (aMessage.deleted) {
queueLogFileCleanup(this.currentPath);
@ -450,7 +450,7 @@ function getDateFromFilename(aFilename) {
let r = aFilename.match(kRegExp);
if (!r) {
Cu.reportError(
console.error(
"Found log file with name not matching YYYY-MM-DD.HHmmSS+ZZzz.format: " +
aFilename
);
@ -587,7 +587,7 @@ Log.prototype = {
let contents = await queueFileOperation(path, () => IOUtils.read(path));
lines = decoder.decode(contents).split("\n");
} catch (aError) {
Cu.reportError('Error reading log file "' + path + '":\n' + aError);
console.error('Error reading log file "' + path + '":\n' + aError);
continue;
}
let nextLine = lines.shift();
@ -759,7 +759,7 @@ Logger.prototype = {
return await IOUtils.getChildren(path);
}
} catch (aError) {
Cu.reportError(
console.error(
'Error getting directory entries for "' + path + '":\n' + aError
);
}
@ -841,7 +841,7 @@ Logger.prototype = {
try {
entries = await IOUtils.getChildren(PathUtils.parent(log.path));
} catch (aError) {
Cu.reportError(
console.error(
'Error getting similar logs for "' + log.path + '":\n' + aError
);
}
@ -861,7 +861,7 @@ Logger.prototype = {
}
if (aAccount.disconnecting) {
Cu.reportError(
console.error(
"Account is still disconnecting while we attempt to remove logs."
);
}
@ -881,7 +881,7 @@ Logger.prototype = {
IOUtils.remove(logPath, { recursive: true });
})
.catch(aError =>
Cu.reportError("Failed to remove log folders:\n" + aError)
console.error("Failed to remove log folders:\n" + aError)
);
},
@ -893,7 +893,7 @@ Logger.prototype = {
entries = entries.concat(await IOUtils.getChildren(path));
} catch (aError) {
if (aErrorMsg) {
Cu.reportError(aErrorMsg + "\n" + aError);
console.error(aErrorMsg + "\n" + aError);
}
}
}
@ -934,7 +934,7 @@ Logger.prototype = {
if (!DOMException.isInstance(aError)) {
throw aError;
}
Cu.reportError("Error sweeping log folder:\n" + aError);
console.error("Error sweeping log folder:\n" + aError);
}
}
},

Просмотреть файл

@ -626,7 +626,7 @@ export var OTR = {
req ? OTRLib.OTRL_POLICY_ALWAYS : OTRLib.OTRL_POLICY_OPPORTUNISTIC
);
if (query.isNull()) {
Cu.reportError(new Error("Sending query message failed."));
console.error(new Error("Sending query message failed."));
return;
}
// Use the default msg to format the version.
@ -1317,9 +1317,7 @@ export var OTR = {
if (err) {
om.cancelled = true;
Cu.reportError(
new Error("Failed to send message. Returned code: " + err)
);
console.error(new Error("Failed to send message. Returned code: " + err));
} else if (!newMessage.isNull()) {
msg = newMessage.readString();
// https://bugs.otr.im/lib/libotr/issues/52

Просмотреть файл

@ -360,7 +360,7 @@ function cleanupNode(aNode, aRules, aTextModifiers) {
// If the node is not allowed, either remove it completely (if
// it is forbidden) or replace it with its children.
if (nodeName in kForbiddenTags) {
Cu.reportError(
console.error(
"removing a " + nodeName + " tag from a message before display"
);
} else {

Просмотреть файл

@ -87,7 +87,7 @@ function getTheme(aName) {
}
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
return theme;
}
@ -104,7 +104,7 @@ function getRegexp() {
}
if ("" in lazy.gTheme.iconsHash) {
Cu.reportError(
console.error(
"Emoticon " +
lazy.gTheme.iconsHash[""].filename +
" matches the empty string!"

Просмотреть файл

@ -225,7 +225,7 @@ function getInfoPlistContent(aBaseURI) {
}
return plistToJSON(node);
} catch (e) {
Cu.reportError(e);
console.error(e);
return null;
}
}
@ -272,7 +272,7 @@ export function getCurrentTheme() {
gCurrentTheme = getThemeByName(name);
gCurrentTheme.variant = variant;
} catch (e) {
Cu.reportError(e);
console.error(e);
gCurrentTheme = getThemeByName(DEFAULT_THEME);
gCurrentTheme.variant = "default";
}
@ -535,7 +535,7 @@ function replaceKeywordsInHTML(aHTML, aReplacements, aReplacementArg) {
if (match[1] in aReplacements) {
content = aReplacements[match[1]](aReplacementArg, match[3]);
} else {
Cu.reportError(
console.error(
"Unknown replacement string %" + match[1] + "% in message styles."
);
}

Просмотреть файл

@ -204,7 +204,7 @@ export function l10nHelper(aChromeURL) {
Array.prototype.slice.call(arguments, 1)
);
} catch (e) {
Cu.reportError(e);
console.error(e);
dump("Failed to get " + aStringId + "\n");
return aStringId;
}

Просмотреть файл

@ -181,7 +181,7 @@ export var Socket = {
this
);
} catch (e) {
Cu.reportError(e);
console.error(e);
// We had some error getting the proxy service, just don't use one.
this._createTransport(null);
}
@ -238,7 +238,7 @@ export var Socket = {
try {
this._outputStream.write(aData, aData.length);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},
@ -253,7 +253,7 @@ export var Socket = {
let stream = converter.convertToInputStream(aString);
this._outputStream.writeFrom(stream, stream.available());
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},

Просмотреть файл

@ -101,7 +101,7 @@ export var ircHandlers = {
_registerHandler(aArray, aHandler) {
// Protect ourselves from adding broken handlers.
if (!("commands" in aHandler)) {
Cu.reportError(
console.error(
new Error(
'IRC handlers must have a "commands" property: ' + aHandler.name
)
@ -109,7 +109,7 @@ export var ircHandlers = {
return false;
}
if (!("isEnabled" in aHandler)) {
Cu.reportError(
console.error(
new Error(
'IRC handlers must have a "isEnabled" property: ' + aHandler.name
)

Просмотреть файл

@ -3317,7 +3317,7 @@ export var XMPPAccountPrototype = {
binval: btoa(data).replace(/.{74}/g, "$&\n"),
};
} catch (e) {
Cu.reportError(e);
console.error(e);
this._cachedUserIcon = null;
}
delete this._cachingUserIcon;

Просмотреть файл

@ -344,7 +344,7 @@ XMPPSession.prototype = {
try {
this._parser.onDataAvailable(aData);
} catch (e) {
Cu.reportError(e);
console.error(e);
this.onXMLError("parser-exception", e);
}
delete this._lastReceivedData;

Просмотреть файл

@ -486,7 +486,7 @@ XMPPParser.prototype = {
try {
this._listener.onXmppStanza(this._node);
} catch (e) {
Cu.reportError(e);
console.error(e);
dump(e + "\n");
}
} else {

Просмотреть файл

@ -113,7 +113,7 @@ class LinkClickHandlerChild extends JSWindowActorChild {
}
} catch (ex) {
if (ex.result != Cr.NS_ERROR_HOST_IS_IP_ADDRESS) {
Cu.reportError(ex);
console.error(ex);
}
}
} catch (ex) {

Просмотреть файл

@ -35,7 +35,7 @@ class LinkHandlerParent extends JSWindowActorParent {
try {
iconURI = Services.io.newURI(iconURL);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
return;
}
if (iconURI.scheme != "data") {

Просмотреть файл

@ -284,7 +284,7 @@ function setFilterFolder(msgFolder) {
wantedFolder = null;
}
} catch (e) {
Cu.reportError(
console.error(
"Failed to select a suitable folder to run filters on: " + e
);
wantedFolder = null;
@ -467,7 +467,7 @@ function calculatePositionAndShowCreateFilterDialog(args) {
// Select the new filter, it is at the position of previous selection.
gFilterListbox.selectItem(gFilterListbox.getItemAtIndex(position));
if (currentFilter() != args.newFilter) {
Cu.reportError("Filter created at an unexpected position!");
console.error("Filter created at an unexpected position!");
}
}
}

Просмотреть файл

@ -76,7 +76,7 @@ var FolderDisplayListenerManager = {
try {
listener[aEventName].apply(listener, aArgs);
} catch (e) {
Cu.reportError(
console.error(
aEventName + " event listener FAILED; " + e + " at: " + e.stack
);
}
@ -648,7 +648,7 @@ FolderDisplayWidget.prototype = {
shouldShowColumn = this.COLUMN_DEFAULT_TESTERS[colId](this.view);
} catch (ex) {
shouldShowColumn = false;
Cu.reportError(ex);
console.error(ex);
}
}
state[colId] = { visible: shouldShowColumn };
@ -1051,7 +1051,7 @@ FolderDisplayWidget.prototype = {
this._clearSavedSelection();
}
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
gDBView = null; // eslint-disable-line no-global-assign
}
@ -2644,7 +2644,7 @@ FolderDisplayWidget.prototype = {
// Something's gone wrong elsewhere, and we likely have bigger problems.
topPadding = 0;
bottomPadding = 0;
Cu.reportError("Unable to get height of folder pane (treeBox is null)");
console.error("Unable to get height of folder pane (treeBox is null)");
}
return [topPadding, bottomPadding];

Просмотреть файл

@ -181,7 +181,7 @@ var gFolderTreeView = {
this._persistColorMap = data.colors;
} catch (ex) {
if (!["NotFoundError"].includes(ex.name)) {
Cu.reportError(
console.error(
gFolderTreeView.messengerBundle.getFormattedString(
"failedToReadFile",
[aJSONFile, ex]
@ -3428,7 +3428,7 @@ var gFolderTreeController = {
if (folder.supportsOffline) {
// Remove the offline store, if any.
await IOUtils.remove(folder.filePath.path, { recursive: true }).catch(
Cu.reportError
console.error
);
}
@ -3495,7 +3495,7 @@ var gFolderTreeController = {
let controller = this;
function renameCallback(aName, aUri) {
if (aUri != folder.URI) {
Cu.reportError("got back a different folder to rename!");
console.error("got back a different folder to rename!");
}
controller._tree.view.selection.clearSelection();

Просмотреть файл

@ -126,7 +126,7 @@ const QueryExplanation = {
}
label = label + constraintStrings.join(", "); // XXX l10n?
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},
};
@ -485,7 +485,7 @@ var FacetContext = {
this._sortBy = val;
this.build(this._sieveAll());
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},
/**
@ -649,7 +649,7 @@ var FacetContext = {
try {
explicitBinding.build(true);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
explicitBinding.removeAttribute("uninitialized");
}
@ -764,7 +764,7 @@ var FacetContext = {
this._hideTimeline(false);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},

Просмотреть файл

@ -489,7 +489,7 @@ var mailContextMenu = {
},
],
})
.catch(Cu.reportError);
.catch(console.error);
Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService)
.loadURI(Services.io.newURI(this.context.linkURL));

Просмотреть файл

@ -127,7 +127,7 @@ function OpenBrowserWithMessageId(messageId) {
try {
messenger.launchExternalURL(browserURL);
} catch (ex) {
Cu.reportError(
console.error(
"Failed to open message-id in browser; browserURL=" + browserURL
);
}

Просмотреть файл

@ -195,7 +195,7 @@ var mailTabType = {
};
return retval;
} catch (e) {
Cu.reportError(e);
console.error(e);
return null;
}
},
@ -277,7 +277,7 @@ var mailTabType = {
}
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},
onTitleChanged(aTab, aTabNode) {

Просмотреть файл

@ -706,7 +706,7 @@ function loadStartPage(aForce) {
let { preferredURI } = Services.uriFixup.getFixupURIInfo(startpage, 0);
MailE10SUtils.loadURI(messagePane, preferredURI.spec);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
} else {
ClearMessagePane();

Просмотреть файл

@ -1785,7 +1785,7 @@ function GetFirstSelectedMsgFolder() {
try {
var selectedFolders = GetSelectedMsgFolders();
} catch (e) {
Cu.reportError(e);
console.error(e);
}
return selectedFolders.length > 0 ? selectedFolders[0] : null;
}
@ -3030,7 +3030,7 @@ function SetupUndoRedoCommand(command) {
}
} catch (ex) {
// If this fails, assume we can't undo or redo.
Cu.reportError(ex);
console.error(ex);
}
if (canUndoOrRedo) {

Просмотреть файл

@ -1084,7 +1084,7 @@ function updateExpandedView() {
try {
AdjustHeaderView(Services.prefs.getIntPref("mail.show_headers"));
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1627,7 +1627,7 @@ AttachmentInfo.prototype = {
let externalFile = fileHandler.getFileFromURLSpec(this.displayUrl);
this._openFile(mimeInfo, externalFile);
} catch (ex) {
Cu.reportError(
console.error(
"AttachmentInfo.open: file - " + this.displayUrl + ", " + ex
);
}
@ -1922,7 +1922,7 @@ AttachmentInfo.prototype = {
try {
fileHandler.getFileFromURLSpec(this.displayUrl).reveal();
} catch (ex) {
Cu.reportError(
console.error(
"AttachmentInfo.openFolder: file - " + this.displayUrl + ", " + ex
);
}
@ -2858,7 +2858,7 @@ function TryHandleAllAttachments(action) {
try {
HandleAllAttachments(action);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -3667,7 +3667,7 @@ const gMessageHeader = {
let uri = Services.io.newURI(url);
navigator.clipboard.writeText(decodeURI(uri.spec));
} catch (e) {
Cu.reportError("Invalid URL: " + url);
console.error("Invalid URL: " + url);
}
},

Просмотреть файл

@ -76,7 +76,7 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function() {
{ shouldSuppress }
);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
return null;
}
});
@ -919,7 +919,7 @@ async function loadPostAccountWizard() {
try {
accountManager.loadVirtualFolders();
} catch (e) {
Cu.reportError(e);
console.error(e);
}
accountManager.addIncomingServerListener(gThreePaneIncomingServerListener);
@ -1090,7 +1090,7 @@ async function atStartupRestoreTabs(aDontRestoreFirstTab) {
try {
tabmail.restoreTabs(tabsState, aDontRestoreFirstTab);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1270,7 +1270,7 @@ async function loadStartFolder(initialUri) {
return;
}
Cu.reportError(ex);
console.error(ex);
}
MsgGetMessagesForAllServers(defaultServer);
@ -1466,7 +1466,7 @@ function ClearMessagePane() {
});
}
} catch (ex) {
Cu.reportError(ex); // error clearing message pane
console.error(ex); // error clearing message pane
}
}

Просмотреть файл

@ -1136,7 +1136,7 @@ class nsContextMenu {
},
],
})
.catch(Cu.reportError);
.catch(console.error);
Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService)
.loadURI(Services.io.newURI(url));
@ -1152,7 +1152,7 @@ class nsContextMenu {
},
],
})
.catch(Cu.reportError);
.catch(console.error);
Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService)
.loadURI(this.linkURI);

Просмотреть файл

@ -229,7 +229,7 @@ var QuickFilterBarMuxer = {
);
QuickFilterBarMuxer.deferredUpdateSearch();
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
};
} else {

Просмотреть файл

@ -116,7 +116,7 @@ var gSanitizePromptDialog = {
try {
s.sanitize();
} catch (er) {
Cu.reportError("Exception during sanitize: " + er);
console.error("Exception during sanitize: " + er);
}
},

Просмотреть файл

@ -66,7 +66,7 @@ function summarizeThread(aSelectedMessages, aMessageDisplay) {
aMessageDisplay
);
} catch (e) {
Cu.reportError(e);
console.error(e);
throw e;
}
});
@ -97,7 +97,7 @@ function summarizeMultipleSelection(aSelectedMessages, aMessageDisplay) {
aMessageDisplay
);
} catch (e) {
Cu.reportError(e);
console.error(e);
throw e;
}
});

Просмотреть файл

@ -138,7 +138,7 @@ var gSpacesToolbar = {
onTabSwitched(newTabInfo, oldTabInfo) {
// Bail out if for whatever reason something went wrong.
if (!newTabInfo) {
Cu.reportError(
console.error(
"Spaces Toolbar: Missing new tab on monitored tab switching"
);
return;

Просмотреть файл

@ -1046,7 +1046,7 @@ var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
return tab;
} catch (e) {
Cu.reportError(e);
console.error(e);
return null;
}
}
@ -1388,7 +1388,7 @@ var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
// Report this so that our unit testing framework sees this
// error and (extension) developers likewise can see when their
// extensions are ill-behaved.
Cu.reportError(ex);
console.error(ex);
}
if (!tabState) {
@ -1922,7 +1922,7 @@ var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
rv = false;
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
}

Просмотреть файл

@ -193,7 +193,7 @@ function openUILink(url, event) {
},
],
})
.catch(Cu.reportError);
.catch(console.error);
let messenger = Cc["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Ci.nsIMessenger);
messenger.launchExternalURL(url);
@ -520,7 +520,7 @@ function openLinkExternally(url) {
},
],
})
.catch(Cu.reportError);
.catch(console.error);
Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService)

Просмотреть файл

@ -209,7 +209,7 @@
this.messagesNode.appendChild(msgNode);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
}
@ -1139,7 +1139,7 @@
return false;
} catch (e) {
return Cu.reportError(e);
return console.error(e);
}
}
@ -1161,7 +1161,7 @@
return false;
} catch (e) {
return Cu.reportError(e);
return console.error(e);
}
}
}
@ -1317,7 +1317,7 @@
);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1334,7 +1334,7 @@
event.preventDefault();
event.stopPropagation();
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1349,7 +1349,7 @@
this.doUndo();
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1401,7 +1401,7 @@
this.undoNode.focus();
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1413,7 +1413,7 @@
this.node.focus();
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1422,7 +1422,7 @@
this.facetNode.includeFacet(this.node);
this.hide();
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1619,7 +1619,7 @@
}
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
// - Starred

Просмотреть файл

@ -62,7 +62,7 @@ function run_test() {
try {
aboutLocale = testIni.getString("Global", "about.en-US");
} catch (e) {
Cu.reportError(e);
console.error(e);
}
if (aboutLocale == undefined) {

Просмотреть файл

@ -69,7 +69,7 @@ const listeners = {
try {
lazy[module].observe(subject, topic, data);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
},
@ -804,7 +804,7 @@ MailGlue.prototype = {
try {
task.task();
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
} finally {
ChromeUtils.addProfilerMarker("startupIdleTask", startTime);
}
@ -854,7 +854,7 @@ MailGlue.prototype = {
try {
await task();
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
} finally {
ChromeUtils.addProfilerMarker("startupLateIdleTask", startTime);
}

Просмотреть файл

@ -38,7 +38,7 @@ function resolveURIInternal(aCmdLine, aArgument) {
return uri;
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
// We have interpreted the argument as a relative file URI, but the file
@ -47,7 +47,7 @@ function resolveURIInternal(aCmdLine, aArgument) {
try {
uri = Services.uriFixup.getFixupURIInfo(aArgument, 0).preferredURI;
} catch (e) {
Cu.reportError(e);
console.error(e);
}
return uri;

Просмотреть файл

@ -72,7 +72,7 @@ window.addEventListener("load", function onload(event) {
$("update-history-row").hidden = true;
}
} catch (e) {
Cu.reportError(
console.error(
"stack of load error for about:support: " + e + ": " + e.stack
);
}
@ -293,7 +293,7 @@ var snapshotFormatters = {
profElem.appendChild(fsTextNode);
}
} catch (x) {
Cu.reportError(x);
console.error(x);
}
// end of TB addition
},

Просмотреть файл

@ -126,7 +126,7 @@ Exception.prototype = {
function NotReached(msg) {
Exception.call(this, msg); // call super constructor
Cu.reportError(this);
console.error(this);
}
// Make NotReached extend Exception.
NotReached.prototype = Object.create(Exception.prototype);

Просмотреть файл

@ -447,7 +447,7 @@ function readAutoDiscoverXML(autoDiscoverXML, username) {
// else unknown or unsupported protocol
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}

Просмотреть файл

@ -353,7 +353,7 @@ FetchHTTP.prototype = {
try {
this._finishedCallback(this);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
} catch (e) {
@ -366,7 +366,7 @@ FetchHTTP.prototype = {
this._errorCallback(e);
} catch (e) {
// error in errorCallback, too!
Cu.reportError(e);
console.error(e);
alertPrompt("Error in errorCallback for fetchhttp", e);
}
},

Просмотреть файл

@ -287,13 +287,13 @@ var gAccountSetup = {
// slower because of one-time overheads like DNS and OCSP. Let's create some
// dummy requests to prime the connections.
let autoconfigURL = Services.prefs.getCharPref("mailnews.auto_config_url");
fetch(autoconfigURL, { method: "OPTIONS" }).catch(Cu.reportError);
fetch(autoconfigURL, { method: "OPTIONS" }).catch(console.error);
let addonsURL = Services.prefs.getCharPref(
"mailnews.auto_config.addons_url"
);
if (new URL(autoconfigURL).origin != new URL(addonsURL).origin) {
fetch(addonsURL, { method: "OPTIONS" }).catch(Cu.reportError);
fetch(addonsURL, { method: "OPTIONS" }).catch(console.error);
}
// The tab monitor will inform us when this tab is getting closed.
@ -1469,7 +1469,7 @@ var gAccountSetup = {
rows.lastChild.remove();
}
} catch (e) {
Cu.reportError(e);
console.error(e);
this.showErrorNotification(e, true);
addonInfoArea.hidden = false;
}

Просмотреть файл

@ -67,13 +67,13 @@ function readFromXML(clientConfigXML, subSource) {
try {
d.displayName = lazy.Sanitizer.label(xml.displayName);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
for (var domain of xml.$domain) {
try {
d.domains.push(lazy.Sanitizer.hostname(domain));
} catch (e) {
Cu.reportError(e);
console.error(e);
exception = e;
}
}
@ -150,21 +150,21 @@ function readFromXML(clientConfigXML, subSource) {
iO.owaURL = lazy.Sanitizer.url(iX.owaURL);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
try {
if ("ewsURL" in iX) {
iO.ewsURL = lazy.Sanitizer.url(iX.ewsURL);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
try {
if ("easURL" in iX) {
iO.easURL = lazy.Sanitizer.url(iX.easURL);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
iO.oauthSettings = {
issuer: iO.hostname,
@ -185,14 +185,14 @@ function readFromXML(clientConfigXML, subSource) {
);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
try {
if ("downloadOnBiff" in iX.pop3) {
iO.downloadOnBiff = lazy.Sanitizer.boolean(iX.pop3.downloadOnBiff);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -203,7 +203,7 @@ function readFromXML(clientConfigXML, subSource) {
);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
// processed successfully, now add to result object
@ -310,7 +310,7 @@ function readFromXML(clientConfigXML, subSource) {
);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
// processed successfully, now add to result object
@ -321,7 +321,7 @@ function readFromXML(clientConfigXML, subSource) {
d.outgoingAlternatives.push(oO);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
exception = e;
}
}
@ -341,7 +341,7 @@ function readFromXML(clientConfigXML, subSource) {
};
d.inputFields.push(fieldset);
} catch (e) {
Cu.reportError(e);
console.error(e);
// For now, don't throw,
// because we don't support custom fields yet anyways.
}

Просмотреть файл

@ -2355,7 +2355,7 @@ var cardsPane = {
this._flavorDataProvider
);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
}
@ -3151,7 +3151,7 @@ var detailsPane = {
try {
date = ICAL.VCardTime.fromDateAndOrTimeString(date);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
return "";
}
if (date.year && date.month && date.day) {

Просмотреть файл

@ -83,7 +83,7 @@ class VCardEdit extends HTMLElement {
this.vCardProperties = VCardProperties.fromVCard(value);
return;
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
}
this.vCardProperties = new VCardProperties("4.0");

Просмотреть файл

@ -142,7 +142,7 @@ class VCardSpecialDateComponent extends HTMLElement {
"date-and-or-time"
);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
// Always set the month first since that controls the available days.
this.month.value = dateValue?.month || "";

Просмотреть файл

@ -257,7 +257,7 @@ function goUpdateCommandState(command) {
dump("no update for command: " + command + "\n");
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
/* eslint-enable complexity */
@ -310,7 +310,7 @@ function goDoCommandParams(command, paramValue) {
}
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -1176,7 +1176,7 @@ async function SaveDocument(aSaveAs, aSaveCopy, aMimeType) {
doUpdateURI = true;
}
} catch (e) {
Cu.reportError(e);
console.error(e);
return false;
}
} // mustShowFileDialog

Просмотреть файл

@ -3654,7 +3654,7 @@ var attachmentWorker = new Worker("resource:///modules/AttachmentChecker.jsm");
attachmentWorker.lastMessage = null;
attachmentWorker.onerror = function(error) {
Cu.reportError("Attachment Notification Worker error!!! " + error.message);
console.error("Attachment Notification Worker error!!! " + error.message);
throw error;
};
@ -4700,7 +4700,7 @@ async function ComposeStartup() {
};
editorElement.webNavigation.loadURI("about:blank?compose", loadURIOptions);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
gEditingDraft = gMsgCompose.compFields.draftId;
@ -5069,7 +5069,7 @@ async function ComposeLoad() {
SetupCommandUpdateHandlers();
await ComposeStartup();
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
Services.prompt.alert(
window,
getComposeBundle().getString("initErrorDlogTitle"),
@ -5893,7 +5893,7 @@ async function GenericSendMessage(msgType) {
await CompleteGenericSendMessage(msgType);
window.dispatchEvent(new CustomEvent("compose-prepare-message-success"));
} catch (exception) {
Cu.reportError(exception);
console.error(exception);
window.dispatchEvent(
new CustomEvent("compose-prepare-message-failure", {
detail: { exception },
@ -5982,7 +5982,7 @@ async function CompleteGenericSendMessage(msgType) {
progress
);
} catch (ex) {
Cu.reportError("GenericSendMessage FAILED: " + ex);
console.error("GenericSendMessage FAILED: " + ex);
ToggleWindowLock(false);
sendError = ex;
}
@ -6553,10 +6553,10 @@ function Save() {
SaveAsFile(false);
break;
case "template":
SaveAsTemplate(false).catch(Cu.reportError);
SaveAsTemplate(false).catch(console.error);
break;
default:
SaveAsDraft(false).catch(Cu.reportError);
SaveAsDraft(false).catch(console.error);
break;
}
}
@ -7397,7 +7397,7 @@ function ComposeCanClose() {
// gets off by one and the app can close unexpectedly on os's that
// shutdown the app when the last window is closed.
GenericSendMessage(Ci.nsIMsgCompDeliverMode.AutoSaveAsDraft).catch(
Cu.reportError
console.error
);
return false;
case 1: // Cancel
@ -7587,7 +7587,7 @@ async function messageAttachmentToFile(attachment) {
if (aStatus == Cr.NS_OK) {
resolve(this._data.join(""));
} else {
Cu.reportError(aStatus);
console.error(aStatus);
reject();
}
},
@ -7658,7 +7658,7 @@ async function AddAttachments(aAttachments, aContentChanged = true) {
attachment.contentLocation = attachment.url;
attachment.url = Services.io.newFileURI(messageFile).spec;
} catch (ex) {
Cu.reportError(
console.error(
`Could not save message attachment ${attachment.url} as file: ${ex}`
);
}
@ -9432,7 +9432,7 @@ var envelopeDragObserver = {
.getURLSpecFromActualFile(data);
isValidAttachment = true;
} catch (e) {
Cu.reportError(
console.error(
"Couldn't process the dragged file " + data.leafName + ":" + e
);
}
@ -9897,7 +9897,7 @@ var envelopeDragObserver = {
imageElement = editor.createElementWithDefaults("img");
} catch (e) {
dump("Failed to create a new image element!\n");
Cu.reportError(e);
console.error(e);
continue;
}
@ -9911,7 +9911,7 @@ var envelopeDragObserver = {
loadBlockedImage(src);
} catch (e) {
dump("Failed to load the appended image!\n");
Cu.reportError(e);
console.error(e);
continue;
}
}
@ -10280,7 +10280,7 @@ async function AutoSave() {
try {
await GenericSendMessage(Ci.nsIMsgCompDeliverMode.AutoSaveAsDraft);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
gAutoSaveKickedIn = true;
}
@ -10665,7 +10665,7 @@ function InitEditor() {
loadBlockedImage(src);
} catch (e) {
// Couldn't load the referenced image.
Cu.reportError(e);
console.error(e);
}
} else {
// Appears to reference a random message. Notify and keep blocking.
@ -10700,7 +10700,7 @@ function InitEditor() {
editor.document.body.background = loadBlockedImage(background, true);
} catch (e) {
// Couldn't load the referenced image.
Cu.reportError(e);
console.error(e);
}
}
}
@ -11011,7 +11011,7 @@ function onUnblockResource(aURL, aNode) {
loadBlockedImage(aURL);
} catch (e) {
// Couldn't load the referenced image.
Cu.reportError(e);
console.error(e);
} finally {
// Remove it from the list on success and failure.
let urls = aNode.value.split(" ");

Просмотреть файл

@ -644,7 +644,7 @@ var gCloudAttachmentLinkManager = {
);
} catch (e) {
// Couldn't load the referenced image.
Cu.reportError(e);
console.error(e);
}
}
}

Просмотреть файл

@ -391,7 +391,7 @@ function Recheck() {
.endSession();
gSpellChecker.InitSpellChecker(GetCurrentEditor(), false, finishRecheck);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
}

Просмотреть файл

@ -206,7 +206,7 @@ var CustomizableUIInternal = {
try {
this._updateForNewVersion();
} catch (e) {
Cu.reportError(e);
console.error(e);
}
this._markObsoleteBuiltinButtonsSeen();
@ -1934,7 +1934,7 @@ var CustomizableUIInternal = {
try {
aWidget.onClick.call(null, aEvent);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
} else {
// XXXunf Need to think this through more, and formalize.
@ -2703,7 +2703,7 @@ var CustomizableUIInternal = {
}
},
err => {
Cu.reportError(err);
console.error(err);
}
);
}
@ -2865,7 +2865,7 @@ var CustomizableUIInternal = {
aArgs
);
} catch (e) {
Cu.reportError(e);
console.error(e);
return undefined;
}
};
@ -4910,7 +4910,7 @@ OverflowableToolbar.prototype = {
);
lazy.PanelMultiView.openPopup(this._panel, anchor || this._chevron, {
triggerEvent: aEvent,
}).catch(Cu.reportError);
}).catch(console.error);
this._chevron.open = true;
this._panel.addEventListener(

Просмотреть файл

@ -237,7 +237,7 @@ var AssociatedToNode = class {
// Any exception in the blocker will cancel the operation.
blockers.add(
promise.catch(ex => {
Cu.reportError(ex);
console.error(ex);
return true;
})
);
@ -256,7 +256,7 @@ var AssociatedToNode = class {
]);
cancel = cancel || results.some(result => result === false);
} catch (ex) {
Cu.reportError(
console.error(
new Error(`One of the blockers for ${eventName} timed out.`)
);
return true;
@ -631,7 +631,7 @@ var PanelMultiView = class extends AssociatedToNode {
* subview when a "title" attribute is not specified.
*/
showSubView(viewIdOrNode, anchor) {
this._showSubView(viewIdOrNode, anchor).catch(Cu.reportError);
this._showSubView(viewIdOrNode, anchor).catch(console.error);
}
async _showSubView(viewIdOrNode, anchor) {
let viewNode =
@ -639,19 +639,19 @@ var PanelMultiView = class extends AssociatedToNode {
? this.document.getElementById(viewIdOrNode)
: viewIdOrNode;
if (!viewNode) {
Cu.reportError(new Error(`Subview ${viewIdOrNode} doesn't exist.`));
console.error(new Error(`Subview ${viewIdOrNode} doesn't exist.`));
return;
}
if (!this.openViews.length) {
Cu.reportError(new Error(`Cannot show a subview in a closed panel.`));
console.error(new Error(`Cannot show a subview in a closed panel.`));
return;
}
let prevPanelView = this.openViews[this.openViews.length - 1];
let nextPanelView = PanelView.forNode(viewNode);
if (this.openViews.includes(nextPanelView)) {
Cu.reportError(new Error(`Subview ${viewNode.id} is already open.`));
console.error(new Error(`Subview ${viewNode.id} is already open.`));
return;
}
@ -723,7 +723,7 @@ var PanelMultiView = class extends AssociatedToNode {
* Navigates backwards by sliding out the most recent subview.
*/
goBack() {
this._goBack().catch(Cu.reportError);
this._goBack().catch(console.error);
}
async _goBack() {
if (this.openViews.length < 2) {
@ -1205,7 +1205,7 @@ var PanelMultiView = class extends AssociatedToNode {
// minimize flicker we need to allow synchronous reflows, and we still
// make sure the ViewShown event is dispatched synchronously.
let mainPanelView = this.openViews[0];
mainPanelView.descriptionHeightWorkaround(true).catch(Cu.reportError);
mainPanelView.descriptionHeightWorkaround(true).catch(console.error);
this._activateView(mainPanelView);
break;
case "popuphidden": {

Просмотреть файл

@ -274,7 +274,7 @@ const PanelUI = {
await PanelMultiView.openPopup(this.panel, anchor, {
triggerEvent: domEvent,
});
})().catch(Cu.reportError);
})().catch(console.error);
},
/**
@ -491,12 +491,12 @@ const PanelUI = {
this._ensureEventListenersAdded();
let viewNode = document.getElementById(aViewId);
if (!viewNode) {
Cu.reportError("Could not show panel subview with id: " + aViewId);
console.error("Could not show panel subview with id: " + aViewId);
return;
}
if (!aAnchor) {
Cu.reportError(
console.error(
"Expected an anchor when opening subview with id: " + aViewId
);
return;
@ -564,7 +564,7 @@ const PanelUI = {
triggerEvent: domEvent,
});
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
if (viewShown) {

Просмотреть файл

@ -81,7 +81,7 @@ var DownloadsView = {
onDownloadChanged(aDownload) {
let item = this.items.get(aDownload);
if (!item) {
Cu.reportError("No DownloadItem found for download");
console.error("No DownloadItem found for download");
return;
}
@ -95,7 +95,7 @@ var DownloadsView = {
onDownloadRemoved(aDownload) {
let item = this.items.get(aDownload);
if (!item) {
Cu.reportError("No DownloadItem found for download");
console.error("No DownloadItem found for download");
return;
}

Просмотреть файл

@ -133,7 +133,7 @@ async function getPhotoFile(id) {
let blob = await result.blob();
return new File([blob], `${id}.${type}`, { type: `image/${type}` });
} catch (ex) {
Cu.reportError(`Failed to read photo information for ${id}: ` + ex);
console.error(`Failed to read photo information for ${id}: ` + ex);
}
return null;
@ -188,7 +188,7 @@ async function setPhotoFile(id, file) {
try {
await IOUtils.remove(oldPhotoFile.path);
} catch (ex) {
Cu.reportError(`Failed to delete old photo file for ${id}: ` + ex);
console.error(`Failed to delete old photo file for ${id}: ` + ex);
}
}
} else {
@ -591,7 +591,7 @@ var addressBookCache = new (class extends EventEmitter {
let photoFile = await File.createFromNsIFile(realPhotoFile);
await addVCardPhotoEntry(vCardProperties, photoFile);
} catch (ex) {
Cu.reportError(
console.error(
`Failed to read photo information for ${node.id}: ` + ex
);
}

Просмотреть файл

@ -63,7 +63,7 @@ this.chrome_settings_overrides = class extends ExtensionAPI {
Services.search.defaultEngine = engine;
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
}
@ -86,7 +86,7 @@ this.chrome_settings_overrides = class extends ExtensionAPI {
try {
await Services.search.removeWebExtensionEngine(id);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
@ -116,7 +116,7 @@ this.chrome_settings_overrides = class extends ExtensionAPI {
static async onUninstall(id) {
let searchStartupPromise = pendingSearchSetupTasks.get(id);
if (searchStartupPromise) {
await searchStartupPromise.catch(Cu.reportError);
await searchStartupPromise.catch(console.error);
}
// Note: We do not have to deal with homepage here as it is managed by
// the ExtensionPreferencesManager.
@ -194,7 +194,7 @@ this.chrome_settings_overrides = class extends ExtensionAPI {
await searchInitialized;
if (!this.extension) {
Cu.reportError(
console.error(
`Extension shut down before search provider was registered`
);
return;
@ -303,7 +303,7 @@ this.chrome_settings_overrides = class extends ExtensionAPI {
);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
return false;
}
return true;

Просмотреть файл

@ -176,7 +176,7 @@ this.extensionScripts = class extends ExtensionAPI {
async unregister(scriptId) {
const script = parentScriptsMap.get(scriptId);
if (!script) {
Cu.reportError(new Error(`No such script ID: ${scriptId}`));
console.error(new Error(`No such script ID: ${scriptId}`));
return;
}

Просмотреть файл

@ -2069,7 +2069,7 @@ var messageTracker = new (class extends EventEmitter {
throw new Error("File has been modified");
}
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
return true;
}
return false;

Просмотреть файл

@ -561,7 +561,7 @@ this.messages = class extends ExtensionAPI {
}
await Promise.all(promises);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
throw new ExtensionError(
`Error ${isMove ? "moving" : "copying"} message: ${ex.message}`
);
@ -717,7 +717,7 @@ this.messages = class extends ExtensionAPI {
throw new ExtensionError(`Message not found: ${messageId}.`);
}
return getRawMessage(msgHdr).catch(ex => {
Cu.reportError(ex);
console.error(ex);
throw new ExtensionError(`Error reading message ${messageId}`);
});
},
@ -1207,7 +1207,7 @@ this.messages = class extends ExtensionAPI {
}
}
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
throw new ExtensionError(`Error updating message: ${ex.message}`);
}
},
@ -1259,7 +1259,7 @@ this.messages = class extends ExtensionAPI {
}
await Promise.all(promises);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
throw new ExtensionError(`Error deleting message: ${ex.message}`);
}
},
@ -1378,7 +1378,7 @@ this.messages = class extends ExtensionAPI {
}
return convertMessage(msgHeader, context.extension);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
throw new ExtensionError(`Error importing message: ${ex.message}`);
}
},
@ -1400,7 +1400,7 @@ this.messages = class extends ExtensionAPI {
archiver.archiveMessages(messages);
});
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
throw new ExtensionError(`Error archiving message: ${ex.message}`);
}
},

Просмотреть файл

@ -227,7 +227,7 @@ class TabsUpdateFilterEventManager extends EventManager {
!extension.hasPermission("tabs") &&
!extension.hasPermission("activeTab")
) {
Cu.reportError(
console.error(
'Url filtering in tabs.onUpdated requires "tabs" or "activeTab" permission.'
);
return false;

Просмотреть файл

@ -419,7 +419,7 @@ var GlodaIMIndexer = {
);
return IOUtils.writeJSON(path, data, {
tmpPath: path + ".tmp",
}).catch(aError => Cu.reportError("Failed to write cache file: " + aError));
}).catch(aError => console.error("Failed to write cache file: " + aError));
},
_knownConversations: {},
@ -545,7 +545,7 @@ var GlodaIMIndexer = {
GlodaIndexer.indexJob(job);
}
conv.logFileCount = logFiles.length;
})().catch(Cu.reportError);
})().catch(console.error);
// Now clear the job, so we can index in the future.
this._knownConversations[convId].scheduledIndex = null;
@ -635,14 +635,14 @@ var GlodaIMIndexer = {
return;
}
if (id || aResultSet.getNextRow()) {
Cu.reportError(
console.error(
"Warning: found more than one gloda conv id for " + aPath + "\n"
);
}
id = id || row.getInt64(0); // We use the first found id.
},
handleError: aError =>
Cu.reportError("Error finding gloda id from path:\n" + aError),
console.error("Error finding gloda id from path:\n" + aError),
handleCompletion: () => {
resolve(id);
},
@ -749,7 +749,7 @@ var GlodaIMIndexer = {
);
if (!aLastModifiedTime) {
Cu.reportError(
console.error(
"indexIMConversation called without lastModifiedTime parameter."
);
}
@ -908,7 +908,7 @@ var GlodaIMIndexer = {
updateStatement.executeAsync({
handleResult: () => {},
handleError: aError =>
Cu.reportError("Error updating bad entry:\n" + aError),
console.error("Error updating bad entry:\n" + aError),
handleCompletion: () => {},
});
}
@ -916,7 +916,7 @@ var GlodaIMIndexer = {
},
handleError: aError =>
Cu.reportError("Error looking for bad entries:\n" + aError),
console.error("Error looking for bad entries:\n" + aError),
handleCompletion: () => {
store.runPostCommit(() => {

Просмотреть файл

@ -46,7 +46,7 @@ httpRequestObserver.prototype = {
}
if (!(aSubject instanceof Ci.nsIHttpChannel)) {
Cu.reportError(
console.error(
"Failed to get a nsIHttpChannel when " +
"observing http-on-examine-response"
);
@ -115,7 +115,7 @@ httpRequestObserver.prototype = {
).currentWindowContext.innerWindowId;
}
} catch (e) {
Cu.reportError(
console.error(
"Could not find an associated window " +
"for an HTTP request. Error: " +
e
@ -215,7 +215,7 @@ TracingListener.prototype = {
// Something went wrong with account set up. Dump the error out to the
// error console, reopen the account provisioner tab, and show an error
// dialog to the user.
Cu.reportError("Problem interpreting provider XML:" + e);
console.error("Problem interpreting provider XML:" + e);
openAccountProvisionerTab();
Services.prompt.alert(window, null, e);

Просмотреть файл

@ -430,13 +430,13 @@ var gConnectionsDialog = {
try {
providers = JSON.parse(rawValue);
} catch (ex) {
Cu.reportError(
console.error(
`Bad JSON data in pref network.trr.resolvers: ${rawValue}`
);
}
}
if (!Array.isArray(providers)) {
Cu.reportError(
console.error(
`Expected a JSON array in network.trr.resolvers: ${rawValue}`
);
providers = [];

Просмотреть файл

@ -161,7 +161,7 @@ var gFontsDialog = {
preference.setElementValue(element);
}
}
})().catch(Cu.reportError);
})().catch(console.error);
},
readFontLanguageGroup() {

Просмотреть файл

@ -899,7 +899,7 @@ var gGeneralPane = {
preference.setElementValue(element);
}
}
})().catch(Cu.reportError);
})().catch(console.error);
},
/**
@ -1628,7 +1628,7 @@ var gGeneralPane = {
radiogroup.value = enabled;
radiogroup.disabled = false;
} catch (error) {
Cu.reportError(error);
console.error(error);
}
}
},
@ -1649,7 +1649,7 @@ var gGeneralPane = {
await UpdateUtils.setAppUpdateAutoEnabled(updateAutoValue);
radiogroup.disabled = false;
} catch (error) {
Cu.reportError(error);
console.error(error);
await this.updateReadPrefs();
await this.reportUpdatePrefWriteError();
return;
@ -2366,7 +2366,7 @@ class HandlerRow {
if (internalMenuItem) {
menu.selectedItem = internalMenuItem;
} else {
Cu.reportError("No menu item defined to set!");
console.error("No menu item defined to set!");
}
break;
case Ci.nsIHandlerInfo.useSystemDefault:

Просмотреть файл

@ -255,7 +255,7 @@ async function gotoPref(aCategory) {
try {
await init_category_if_required(category);
} catch (ex) {
Cu.reportError(
console.error(
new Error(
"Error initializing preference category " + category + ": " + ex
)

Просмотреть файл

@ -30,7 +30,7 @@ class PromptCollection {
);
stayLabel = this.domBundle.GetStringFromName("OnBeforeUnloadStayButton");
} catch (exception) {
Cu.reportError("Failed to get strings from dom.properties");
console.error("Failed to get strings from dom.properties");
return false;
}

Просмотреть файл

@ -3249,7 +3249,7 @@ Enigmail.msg = {
break;
default:
Cu.reportError(
console.error(
"Unexpected msgSignatureState: " + Enigmail.hdrView.msgSignatureState
);
}
@ -3296,7 +3296,7 @@ Enigmail.msg = {
break;
default:
Cu.reportError(
console.error(
"Unexpected msgEncryptionState: " +
Enigmail.hdrView.msgEncryptionState
);

Просмотреть файл

@ -139,7 +139,7 @@ Enigmail.msg = {
true
);
await OpenPGPAlias.load().catch(Cu.reportError);
await OpenPGPAlias.load().catch(console.error);
Enigmail.msg.composeOpen();
//Enigmail.msg.processFinalState();
@ -2335,7 +2335,7 @@ Enigmail.msg = {
event.stopPropagation();
}
} catch (ex) {
Cu.reportError("GenericSendMessage FAILED: " + ex);
console.error("GenericSendMessage FAILED: " + ex);
this.resetUpdatedFields();
event.preventDefault();
event.stopPropagation();

Просмотреть файл

@ -765,7 +765,7 @@ var gKeyAssistant = {
}
await PgpSqliteDb2.addAcceptedEmail(fingerprint, recipient).catch(
Cu.reportError
console.error
);
// Trigger the UI refresh of the compose window.

Просмотреть файл

@ -31,7 +31,7 @@ class ConversationOpener {
this._msgHdr = messages[0];
this._queries = [Gloda.getMessageCollectionForHeaders(messages, this)];
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
onItemsAdded(items) {}
@ -40,7 +40,7 @@ class ConversationOpener {
onQueryCompleted(collection) {
try {
if (!collection.items.length) {
Cu.reportError("Couldn't find a collection for msg: " + this._msgHdr);
console.error("Couldn't find a collection for msg: " + this._msgHdr);
} else {
let message = collection.items[0];
this.window.browsingContext.topChromeWindow.document
@ -53,7 +53,7 @@ class ConversationOpener {
});
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
}

Просмотреть файл

@ -225,7 +225,7 @@ var FolderNotificationHelper = {
if (ex.stack) {
dump("STACK: " + ex.stack + "\n");
}
Cu.reportError(ex);
console.error(ex);
}
}
delete this._pendingFolderUriToViewWrapperLists[folderURI];

Просмотреть файл

@ -34,12 +34,12 @@ var ExtensionSupport = {
*/
registerWindowListener(aID, aExtensionHook) {
if (!aID) {
Cu.reportError("No extension ID provided for the window listener");
console.error("No extension ID provided for the window listener");
return false;
}
if (extensionHooks.has(aID)) {
Cu.reportError(
console.error(
"Window listener for extension + '" + aID + "' already registered"
);
return false;
@ -49,7 +49,7 @@ var ExtensionSupport = {
!("onLoadWindow" in aExtensionHook) &&
!("onUnloadWindow" in aExtensionHook)
) {
Cu.reportError(
console.error(
"The extension + '" + aID + "' does not provide any callbacks"
);
return false;
@ -95,13 +95,13 @@ var ExtensionSupport = {
*/
unregisterWindowListener(aID) {
if (!aID) {
Cu.reportError("No extension ID provided for the window listener");
console.error("No extension ID provided for the window listener");
return false;
}
let windowListener = extensionHooks.get(aID);
if (!windowListener) {
Cu.reportError(
console.error(
"Couldn't remove window listener for extension + '" + aID + "'"
);
return false;

Просмотреть файл

@ -1302,7 +1302,7 @@ function getLocalizedFragment(doc, msg, ...nodesOrStrings) {
}
let numberOfInsertionPoints = msg.match(/%\d+\$S/g).length;
if (numberOfInsertionPoints != nodesOrStrings.length) {
Cu.reportError(
console.error(
`Message has ${numberOfInsertionPoints} insertion points, ` +
`but got ${nodesOrStrings.length} replacement parameters!`
);

Просмотреть файл

@ -799,7 +799,7 @@ PopupNotifications.prototype = {
}
popupnotification.setAttribute("origin", uri);
} catch (e) {
Cu.reportError(e);
console.error(e);
popupnotification.removeAttribute("origin");
}
} else {
@ -1320,7 +1320,7 @@ PopupNotifications.prototype = {
let other = otherBrowser.ownerGlobal.PopupNotifications;
if (!other) {
if (ourNotifications.length > 0) {
Cu.reportError(
console.error(
"unable to swap notifications: otherBrowser doesn't support notifications"
);
}
@ -1369,7 +1369,7 @@ PopupNotifications.prototype = {
return n.options.eventCallback.call(n, event, ...args);
}
} catch (error) {
Cu.reportError(error);
console.error(error);
}
return undefined;
},
@ -1556,7 +1556,7 @@ PopupNotifications.prototype = {
source,
});
} catch (error) {
Cu.reportError(error);
console.error(error);
}
if (action.dismiss) {
@ -1588,7 +1588,7 @@ PopupNotifications.prototype = {
source: "menucommand",
});
} catch (error) {
Cu.reportError(error);
console.error(error);
}
if (target.action.dismiss) {

Просмотреть файл

@ -162,7 +162,7 @@ var MailMigrator = {
if (["NotFoundError"].includes(ex.name)) {
IOUtils.writeJSON(spec, ["moz-abdirectory://?"]);
} else {
Cu.reportError(ex);
console.error(ex);
}
});
}
@ -490,7 +490,7 @@ var MailMigrator = {
try {
MailServices.accounts.reorderAccounts(accountKeyList);
} catch (error) {
Cu.reportError(
console.error(
"Migrating account list order failed. Error message was: " +
error +
" -- Will not reattempt migration."
@ -677,7 +677,7 @@ var MailMigrator = {
// Update the migration version.
Services.prefs.setIntPref(UI_VERSION_PREF, UI_VERSION);
} catch (e) {
Cu.reportError(
console.error(
"Migrating from UI version " +
currentUIVersion +
" to " +
@ -760,7 +760,7 @@ var MailMigrator = {
try {
await this._migrateRSSSubscriptions(legacyFeedsFile, feedsFile);
} catch (err) {
Cu.reportError(
console.error(
"Failed to migrate '" +
feedsFile.path +
"' to '" +
@ -777,7 +777,7 @@ var MailMigrator = {
try {
await this._migrateRSSItems(legacyItemsFile, itemsFile);
} catch (err) {
Cu.reportError(
console.error(
"Failed to migrate '" +
itemsFile.path +
"' to '" +

Просмотреть файл

@ -633,7 +633,7 @@ var MailUtils = {
}
folder.closeDBIfFolderNotOpen(true);
} catch (ex) {
Cu.reportError(`Database for ${folder.name} not accessible`);
console.error(`Database for ${folder.name} not accessible`);
}
}

Просмотреть файл

@ -209,7 +209,7 @@ MessageArchiver.prototype = {
onStopOperation(aResult) {
if (!Components.isSuccessCode(aResult)) {
Cu.reportError("Archive filter failed: " + aResult);
console.error("Archive filter failed: " + aResult);
// We don't want to effectively disable archiving because a filter
// failed, so we'll continue after reporting the error.
}
@ -352,7 +352,7 @@ MessageArchiver.prototype = {
if (Components.isSuccessCode(exitCode)) {
this.continueBatch();
} else {
Cu.reportError("Archive failed to create folder: " + exitCode);
console.error("Archive failed to create folder: " + exitCode);
this._batches = null;
this.processNextBatch(); // for cleanup and exit
}
@ -370,7 +370,7 @@ MessageArchiver.prototype = {
this.processNextBatch();
} else {
// stop on error
Cu.reportError("Archive failed to copy: " + aStatus);
console.error("Archive failed to copy: " + aStatus);
this._batches = null;
this.processNextBatch(); // for cleanup and exit
}

Просмотреть файл

@ -268,7 +268,7 @@ QuickFilterSearchListener.prototype = {
try {
this.listener.onSearchMessage(this.scratch, aMsgHdr, aFolder);
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
},
@ -552,7 +552,7 @@ var QuickFilterManager = {
listeners.push([listener, filterDef]);
}
} catch (ex) {
Cu.reportError(ex);
console.error(ex);
}
}
return searchTerms.length ? [searchTerms, listeners] : [null, listeners];

Просмотреть файл

@ -440,7 +440,7 @@ SearchSpec.prototype = {
onlineAvailable = customTerm.getAvailable(serverScope, term.op);
} else {
// maybe an extension with a custom term was unloaded?
Cu.reportError(
console.error(
"Custom search term " + term.customId + " missing"
);
}
@ -514,7 +514,7 @@ SearchSpecListener.prototype = {
// searching should already be true by the time this happens. if it's not,
// it means some code is poking at the search session. bad!
if (!this.searchSpec.owner.searching) {
Cu.reportError("Search originated from unknown initiator! Confusion!");
console.error("Search originated from unknown initiator! Confusion!");
this.searchSpec.owner.searching = true;
}
},

Просмотреть файл

@ -126,7 +126,7 @@ var SessionStoreManager = {
*/
_saveStateObject(aStateObj) {
if (!this.store) {
Cu.reportError(
console.error(
"SessionStoreManager: could not create data store from file"
);
return;

Просмотреть файл

@ -89,7 +89,7 @@ SummaryFrameManager.prototype = {
if (
this.pendingOrLoadedUrl != this.iframe.contentDocument.location.href
) {
Cu.reportError(
console.error(
"Please do not load stuff in the multimessage browser directly, " +
"use the SummaryFrameManager instead."
);
@ -97,7 +97,7 @@ SummaryFrameManager.prototype = {
this.callback(true);
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
},
};

Просмотреть файл

@ -72,7 +72,7 @@ var TBDistCustomizer = {
break;
}
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
}
@ -97,7 +97,7 @@ var TBDistCustomizer = {
localizedStr
);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
}
@ -116,7 +116,7 @@ var TBDistCustomizer = {
localizedStr
);
} catch (e) {
Cu.reportError(e);
console.error(e);
}
}
}

Просмотреть файл

@ -130,7 +130,7 @@ function findTagColorSheet(aDocument) {
}
}
if (!tagSheet) {
Cu.reportError("TagUtils.findTagColorSheet: tagColors.css not found");
console.error("TagUtils.findTagColorSheet: tagColors.css not found");
}
return tagSheet;
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше