@@ -13,7 +13,7 @@ function reportError(error: Error | string) {
1313import { spawn , exec , ChildProcess } from 'child_process' ;
1414import * as os from 'os' ;
1515import * as path from 'path' ;
16- import { app , BrowserWindow , shell , Menu , Notification } from 'electron' ;
16+ import { app , BrowserWindow , shell , Menu , dialog } from 'electron' ;
1717
1818import * as windowStateKeeper from 'electron-window-state' ;
1919
@@ -174,9 +174,9 @@ if (!amMainInstance) {
174174 } ) ;
175175 } ) ;
176176
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 ) ;
180180 }
181181
182182 async function startServer ( retries = 2 ) {
@@ -235,8 +235,8 @@ if (!amMainInstance) {
235235 Sentry . addBreadcrumb ( { category : 'server-exit' , message : error . message , level : < any > 'error' , data : { serverRunTime } } ) ;
236236 reportError ( error ) ;
237237
238- showNotification (
239- 'HTTP Toolkit crashed ' ,
238+ showErrorAlert (
239+ 'HTTP Toolkit hit an error ' ,
240240 `${ error . message } . Please file an issue at github.com/httptoolkit/feedback.`
241241 ) ;
242242
0 commit comments