Bug 1800247 - Replace incorrect uses of two-argument Cu.reportError with console.error or equivalent (AboutProtectionsParent.sys.mjs). r=pbz

Differential Revision: https://phabricator.services.mozilla.com/D161922
This commit is contained in:
Mark Banner 2022-11-14 21:27:46 +00:00
parent ad773a278e
commit eb858c768b

View file

@ -176,7 +176,7 @@ export class AboutProtectionsParent extends JSWindowActorParent {
await lazy.fxAccounts.device.refreshDeviceList(); await lazy.fxAccounts.device.refreshDeviceList();
} }
} catch (e) { } catch (e) {
Cu.reportError("There was an error fetching login data: ", e.message); console.error("There was an error fetching login data: ", e.message);
} }
const userFacingLogins = const userFacingLogins =
@ -250,7 +250,7 @@ export class AboutProtectionsParent extends JSWindowActorParent {
}; };
} }
} catch (e) { } catch (e) {
Cu.reportError(e.message); console.error(e.message);
monitorData.errorMessage = e.message; monitorData.errorMessage = e.message;
// If the user's OAuth token is invalid, we clear the cached token and refetch // If the user's OAuth token is invalid, we clear the cached token and refetch
@ -263,7 +263,7 @@ export class AboutProtectionsParent extends JSWindowActorParent {
try { try {
monitorData = await this.fetchUserBreachStats(token); monitorData = await this.fetchUserBreachStats(token);
} catch (_) { } catch (_) {
Cu.reportError(e.message); console.error(e.message);
} }
} else if (e.message === USER_UNSUBSCRIBED_TO_MONITOR) { } else if (e.message === USER_UNSUBSCRIBED_TO_MONITOR) {
// Send back user's email so the protections report can direct them to the proper // Send back user's email so the protections report can direct them to the proper
@ -288,7 +288,7 @@ export class AboutProtectionsParent extends JSWindowActorParent {
try { try {
token = await lazy.fxAccounts.getOAuthToken({ scope: SCOPE_MONITOR }); token = await lazy.fxAccounts.getOAuthToken({ scope: SCOPE_MONITOR });
} catch (e) { } catch (e) {
Cu.reportError( console.error(
"There was an error fetching the user's token: ", "There was an error fetching the user's token: ",
e.message e.message
); );
@ -328,7 +328,7 @@ export class AboutProtectionsParent extends JSWindowActorParent {
try { try {
vpnToken = await lazy.fxAccounts.getOAuthToken({ scope: SCOPE_VPN }); vpnToken = await lazy.fxAccounts.getOAuthToken({ scope: SCOPE_VPN });
} catch (e) { } catch (e) {
Cu.reportError( console.error(
"There was an error fetching the user's token: ", "There was an error fetching the user's token: ",
e.message e.message
); );