From 43373d1a4fee8a45b53a892067bf190331d3fac3 Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Tue, 4 May 2021 14:59:45 -0500 Subject: [PATCH] handle nps errors instead of throwing them out the top --- server/services/nps/getAndCreateNpsSurvey.ts | 3 ++- server/services/nps/sendNpsResults.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/services/nps/getAndCreateNpsSurvey.ts b/server/services/nps/getAndCreateNpsSurvey.ts index 03ef16e821ae..3d0bd328c429 100644 --- a/server/services/nps/getAndCreateNpsSurvey.ts +++ b/server/services/nps/getAndCreateNpsSurvey.ts @@ -62,6 +62,7 @@ export const getAndCreateNpsSurvey = Meteor.bindEnvironment(async function getNp await Banner.create(banner); } catch (e) { - throw new Error(e); + console.error(e); + return false; } }); diff --git a/server/services/nps/sendNpsResults.ts b/server/services/nps/sendNpsResults.ts index 1d6517dd0f5a..73ade663c082 100644 --- a/server/services/nps/sendNpsResults.ts +++ b/server/services/nps/sendNpsResults.ts @@ -26,6 +26,7 @@ export const sendNpsResults = Meteor.bindEnvironment(function sendNpsResults(nps data, }); } catch (e) { - throw new Error(e); + console.error(e); + return false; } });