From 6e51d6054e44b8e32d7d203ae50d7cf2e8495993 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 4 Apr 2022 15:14:26 -0700 Subject: [PATCH] Ignore errors from telemetry. --- scripts/telemetry.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/telemetry.js b/scripts/telemetry.js index 64e537f3..100e6864 100644 --- a/scripts/telemetry.js +++ b/scripts/telemetry.js @@ -39,14 +39,18 @@ async function sendTelemetry(action) { upgrade, }; - await fetch(url, { - method: 'post', - cache: 'no-cache', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(payload), - }); + try { + await fetch(url, { + method: 'post', + cache: 'no-cache', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload), + }); + } catch { + // Ignore + } } module.exports = {