@@ -13,7 +13,7 @@ function reportError(error: Error | string) {
13
13
import { spawn , exec , ChildProcess } from 'child_process' ;
14
14
import * as os from 'os' ;
15
15
import * as path from 'path' ;
16
- import { app , BrowserWindow , shell , Menu , Notification } from 'electron' ;
16
+ import { app , BrowserWindow , shell , Menu , dialog } from 'electron' ;
17
17
18
18
import * as windowStateKeeper from 'electron-window-state' ;
19
19
@@ -174,9 +174,9 @@ if (!amMainInstance) {
174
174
} ) ;
175
175
} ) ;
176
176
177
- function showNotification ( title : string , body : string ) {
178
- const notification = new Notification ( { title, body , icon : path . join ( __dirname , 'src' , 'icon.png' ) } ) ;
179
- notification . show ( ) ;
177
+ function showErrorAlert ( title : string , body : string ) {
178
+ console . warn ( ` ${ title } : ${ body } ` ) ;
179
+ dialog . showErrorBox ( title , body ) ;
180
180
}
181
181
182
182
async function startServer ( retries = 2 ) {
@@ -235,8 +235,8 @@ if (!amMainInstance) {
235
235
Sentry . addBreadcrumb ( { category : 'server-exit' , message : error . message , level : < any > 'error' , data : { serverRunTime } } ) ;
236
236
reportError ( error ) ;
237
237
238
- showNotification (
239
- 'HTTP Toolkit crashed ' ,
238
+ showErrorAlert (
239
+ 'HTTP Toolkit hit an error ' ,
240
240
`${ error . message } . Please file an issue at github.com/httptoolkit/feedback.`
241
241
) ;
242
242
0 commit comments