From 1c0380087293499190424b9c79866351e93dc53e Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Fri, 13 Oct 2017 11:43:59 -0400 Subject: [PATCH] Dont notify in prod environment --- src/internal-plugins/metrics/lib/setup.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/internal-plugins/metrics/lib/setup.js b/src/internal-plugins/metrics/lib/setup.js index 0fe7d566362..173b15398c3 100644 --- a/src/internal-plugins/metrics/lib/setup.js +++ b/src/internal-plugins/metrics/lib/setup.js @@ -94,13 +94,15 @@ module.exports = function() { window.addEventListener('error', function(err) { debug('error encountered, notify trackers', err); // Notify user that error occurred - if (!_.includes(err.message, 'MongoError')) { - Notifier.notify({ - 'icon': ICON_PATH, - 'message': 'Unexpected error occurred: ' + err.message, - 'title': 'MongoDB Compass Exception', - 'wait': true - }); + if (process.env.NODE_ENV !== 'production') { + if (!_.includes(err.message, 'MongoError')) { + Notifier.notify({ + 'icon': ICON_PATH, + 'message': 'Unexpected error occurred: ' + err.message, + 'title': 'MongoDB Compass Exception', + 'wait': true + }); + } } metrics.error(err); // hide progress bar when an unknown error occurs.