From fa1386f8092f30bf8ef1ab47f49dc795a93c0525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20Emir=20=C5=9Een?= Date: Mon, 22 May 2023 16:08:35 +0300 Subject: [PATCH] fix: error handling on telemetry call (#344) * fix: exception handling on telemetry * 1.15.5 --- package-lock.json | 4 ++-- package.json | 2 +- src/saofile.ts | 20 ++++++++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 166dab84..23da8040 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "superplate-cli", - "version": "1.15.4", + "version": "1.15.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "superplate-cli", - "version": "1.15.3", + "version": "1.15.5", "license": "MIT", "dependencies": { "analytics-node": "^6.0.0", diff --git a/package.json b/package.json index b523d3f3..231c344d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superplate-cli", - "version": "1.15.4", + "version": "1.15.5", "description": "The frontend boilerplate with superpowers", "license": "MIT", "repository": { diff --git a/src/saofile.ts b/src/saofile.ts index f5ddbdca..9b998b34 100644 --- a/src/saofile.ts +++ b/src/saofile.ts @@ -329,14 +329,18 @@ const saoConfig: GeneratorConfig = { const { telemetry } = await prompt_telemetry(); if (telemetry === "yes") { - analytics.track({ - event: "generate", - properties: { - ...sao.answers, - type: sao.opts.extras.projectType, - }, - anonymousId: uuidv4(), - }); + try { + analytics.track({ + event: "generate", + properties: { + ...sao.answers, + type: sao.opts.extras.projectType, + }, + anonymousId: uuidv4(), + }); + } catch (error) { + // + } } }