mirror of
https://github.com/frappe/books.git
synced 2026-08-24 10:04:45 -05:00
fix: use unlinkIfExists
- handle failed migration copy issue separately
This commit is contained in:
@@ -13,7 +13,7 @@ export default function registerAutoUpdaterListeners(main: Main) {
|
||||
return;
|
||||
}
|
||||
|
||||
main.mainWindow!.webContents.send(IPC_CHANNELS.MAIN_PROCESS_ERROR, error);
|
||||
main.mainWindow!.webContents.send(IPC_CHANNELS.LOG_MAIN_PROCESS_ERROR, error);
|
||||
dialog.showErrorBox(
|
||||
'Update Error: ',
|
||||
error == null ? 'unknown' : (error.stack || error).toString()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { app } from 'electron';
|
||||
import { IPC_CHANNELS } from 'utils/messages';
|
||||
import { CUSTOM_EVENTS, IPC_CHANNELS } from 'utils/messages';
|
||||
import { Main } from '../main';
|
||||
|
||||
export default function registerProcessListeners(main: Main) {
|
||||
@@ -17,12 +17,25 @@ export default function registerProcessListeners(main: Main) {
|
||||
}
|
||||
}
|
||||
|
||||
process.on(CUSTOM_EVENTS.MAIN_PROCESS_ERROR, (error) => {
|
||||
main.mainWindow!.webContents.send(
|
||||
IPC_CHANNELS.LOG_MAIN_PROCESS_ERROR,
|
||||
error
|
||||
);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (error) => {
|
||||
main.mainWindow!.webContents.send(IPC_CHANNELS.MAIN_PROCESS_ERROR, error);
|
||||
main.mainWindow!.webContents.send(
|
||||
IPC_CHANNELS.LOG_MAIN_PROCESS_ERROR,
|
||||
error
|
||||
);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', (error) => {
|
||||
main.mainWindow!.webContents.send(IPC_CHANNELS.MAIN_PROCESS_ERROR, error);
|
||||
main.mainWindow!.webContents.send(
|
||||
IPC_CHANNELS.LOG_MAIN_PROCESS_ERROR,
|
||||
error
|
||||
);
|
||||
setTimeout(() => process.exit(1), 10000);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user