diff options
author | 2021-12-18 02:16:55 +0100 | |
---|---|---|
committer | 2021-12-18 02:16:55 +0100 | |
commit | 547d462243b26b3c1ee1dcf040f7d63081a1a4af (patch) | |
tree | d91463319ccf0ab906d1aa873244808df1e27df9 /src/electron/ipc-api/autoUpdate.ts | |
parent | Upgrade electron-updater from 4.6.2 to 4.6.5 (diff) | |
download | ferdium-app-547d462243b26b3c1ee1dcf040f7d63081a1a4af.tar.gz ferdium-app-547d462243b26b3c1ee1dcf040f7d63081a1a4af.tar.zst ferdium-app-547d462243b26b3c1ee1dcf040f7d63081a1a4af.zip |
Better error handling for autoUpdater
Diffstat (limited to 'src/electron/ipc-api/autoUpdate.ts')
-rw-r--r-- | src/electron/ipc-api/autoUpdate.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/electron/ipc-api/autoUpdate.ts b/src/electron/ipc-api/autoUpdate.ts index e6b805edc..33af57efc 100644 --- a/src/electron/ipc-api/autoUpdate.ts +++ b/src/electron/ipc-api/autoUpdate.ts | |||
@@ -39,8 +39,7 @@ export default (params: { mainWindow: BrowserWindow; settings: any }) => { | |||
39 | }, 20); | 39 | }, 20); |
40 | } | 40 | } |
41 | } catch (error) { | 41 | } catch (error) { |
42 | console.error(error); | 42 | event.sender.send('autoUpdate', { error }); |
43 | event.sender.send('autoUpdate', { error: true }); | ||
44 | } | 43 | } |
45 | } | 44 | } |
46 | }); | 45 | }); |
@@ -74,9 +73,9 @@ export default (params: { mainWindow: BrowserWindow; settings: any }) => { | |||
74 | params.mainWindow.webContents.send('autoUpdate', { downloaded: true }); | 73 | params.mainWindow.webContents.send('autoUpdate', { downloaded: true }); |
75 | }); | 74 | }); |
76 | 75 | ||
77 | autoUpdater.on('error', () => { | 76 | autoUpdater.on('error', error => { |
78 | debug('update-error'); | 77 | debug('update-error'); |
79 | params.mainWindow.webContents.send('autoUpdate', { error: true }); | 78 | params.mainWindow.webContents.send('autoUpdate', { error }); |
80 | }); | 79 | }); |
81 | } | 80 | } |
82 | }; | 81 | }; |