fix(updater): handle undefined error when updater not provide error content (#524)
* fix(updater): check updater error is exists or not * set default error message
This commit is contained in:
committed by
László Monda
parent
5d1cc9202b
commit
8bb9f7f839
@@ -37,8 +37,13 @@ export class AppUpdateService extends MainServiceBase {
|
||||
});
|
||||
|
||||
autoUpdater.on('error', (ev: any, err: string) => {
|
||||
console.error('[AppUpdateService] error', err);
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateError, err.substr(0, 100));
|
||||
this.logService.error('[AppUpdateService] error', err)
|
||||
let msg = 'Electron updater error';
|
||||
if (err) {
|
||||
msg = err.substr(0, 100);
|
||||
}
|
||||
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateError, msg);
|
||||
});
|
||||
|
||||
autoUpdater.on('download-progress', (progressObj: ProgressInfo) => {
|
||||
|
||||
Reference in New Issue
Block a user