File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 143
143
"mongodb-shell-to-url" : " ^0.1.0" ,
144
144
"ms" : " ^0.7.1" ,
145
145
"ncp" : " ^2.0.0" ,
146
+ "node-notifier" : " ^4.3.1" ,
146
147
"numeral" : " ^1.5.3" ,
147
148
"pluralize" : " ^1.2.1" ,
148
149
"qs" : " ^5.2.0" ,
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ var format = require('util').format;
7
7
var ipc = require ( 'hadron-ipc' ) ;
8
8
var intercom = require ( './intercom' ) ;
9
9
var features = require ( './features' ) ;
10
+ var Notifier = require ( 'node-notifier' ) ;
11
+ var process = require ( 'process' ) ;
10
12
11
13
var debug = require ( 'debug' ) ( 'mongodb-compass:metrics' ) ;
12
14
@@ -94,6 +96,19 @@ module.exports = function() {
94
96
95
97
window . addEventListener ( 'error' , function ( err ) {
96
98
debug ( 'error encountered, notify trackers' , err ) ;
99
+ // Notify user that error occurred
100
+ if ( ! _ . includes ( err . message , 'MongoError' ) ) {
101
+ var icon = pkg . config . hadron . build . win32 . icon ;
102
+ if ( process . platform === 'darwin' ) {
103
+ icon = pkg . config . hadron . build . darwin . icon ;
104
+ }
105
+ Notifier . notify ( {
106
+ 'icon' : icon ,
107
+ 'message' : 'Unexpected error occurred: ' + err . message ,
108
+ 'title' : 'MongoDB Compass Exception' ,
109
+ 'wait' : true
110
+ } ) ;
111
+ }
97
112
metrics . error ( err ) ;
98
113
} ) ;
99
114
You can’t perform that action at this time.
0 commit comments