mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
perf(core): better communication of internal exceptions
This commit is contained in:
@@ -97,7 +97,16 @@ else {
|
||||
app.on('ready', async () => {
|
||||
mainWindow = await createMainWindow();
|
||||
Menu.setApplicationMenu(null);
|
||||
|
||||
if (isDevelopment)
|
||||
mainWindow.webContents.openDevTools();
|
||||
|
||||
process.on('uncaughtException', error => {
|
||||
mainWindow.webContents.send('unhandled-exception', error);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', error => {
|
||||
mainWindow.webContents.send('unhandled-exception', error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -5,12 +5,14 @@ import Vuex from 'vuex';
|
||||
|
||||
import application from './modules/application.store';
|
||||
import settings from './modules/settings.store';
|
||||
import history from './modules/history.store';
|
||||
import scratchpad from './modules/scratchpad.store';
|
||||
import connections from './modules/connections.store';
|
||||
import workspaces from './modules/workspaces.store';
|
||||
import notifications from './modules/notifications.store';
|
||||
|
||||
import ipcUpdates from './plugins/ipcUpdates';
|
||||
import ipcExceptions from './plugins/ipcExceptions';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
@@ -19,12 +21,14 @@ export default new Vuex.Store({
|
||||
modules: {
|
||||
application,
|
||||
settings,
|
||||
history,
|
||||
scratchpad,
|
||||
connections,
|
||||
workspaces,
|
||||
notifications
|
||||
},
|
||||
plugins: [
|
||||
ipcUpdates
|
||||
ipcUpdates,
|
||||
ipcExceptions
|
||||
]
|
||||
});
|
||||
|
7
src/renderer/store/plugins/ipcExceptions.js
Normal file
7
src/renderer/store/plugins/ipcExceptions.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
export default store => {
|
||||
ipcRenderer.on('unhandled-exception', (event, error) => {
|
||||
store.dispatch('notifications/addNotification', { status: 'error', message: error.message });
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user