Skip to content

Commit 6b60fb3

Browse files
authored
Dont notify in prod environment (#1270)
1 parent f85c3e5 commit 6b60fb3

File tree

1 file changed

+9
-7
lines changed
  • src/internal-plugins/metrics/lib

1 file changed

+9
-7
lines changed

src/internal-plugins/metrics/lib/setup.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ module.exports = function() {
9494
window.addEventListener('error', function(err) {
9595
debug('error encountered, notify trackers', err);
9696
// Notify user that error occurred
97-
if (!_.includes(err.message, 'MongoError')) {
98-
Notifier.notify({
99-
'icon': ICON_PATH,
100-
'message': 'Unexpected error occurred: ' + err.message,
101-
'title': 'MongoDB Compass Exception',
102-
'wait': true
103-
});
97+
if (process.env.NODE_ENV !== 'production') {
98+
if (!_.includes(err.message, 'MongoError')) {
99+
Notifier.notify({
100+
'icon': ICON_PATH,
101+
'message': 'Unexpected error occurred: ' + err.message,
102+
'title': 'MongoDB Compass Exception',
103+
'wait': true
104+
});
105+
}
104106
}
105107
metrics.error(err);
106108
// hide progress bar when an unknown error occurs.

0 commit comments

Comments
 (0)