When I throw an error directly in the main process, I get an error dialog, but the electron process does not quit after confirming the dialog.
throw new Error('test');
When I throw an error in an async IIFE (to be able to await the app ready event), I don't get a dialog, the process also does not exit:
void (async () => {
await app.whenReady();
throw new Error('test');
})();
What's the best practice to handle an error in the main process?
I could catch() the error and app.quit() the process or add a process.on('uncaughtException') handler but there is no dialog for the user that something went wrong.