diff --git a/package.json b/package.json index 56c91e5a..2b4b2aa9 100644 --- a/package.json +++ b/package.json @@ -104,14 +104,14 @@ "sql-formatter": "^4.0.2", "ssh2-promise": "^0.2.0", "v-mask": "^2.2.4", - "vue-i18n": "^8.24.4", + "vue-i18n": "^8.25.1", "vuedraggable": "^2.24.3", "vuex": "^3.6.2" }, "devDependencies": { "@babel/eslint-parser": "^7.15.4", "cross-env": "^7.0.2", - "electron": "^14.0.0", + "electron": "^14.0.1", "electron-builder": "^22.11.7", "electron-devtools-installer": "^3.2.0", "electron-webpack": "^2.8.2", @@ -122,12 +122,12 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-vue": "^7.17.0", - "sass": "^1.39.2", + "sass": "^1.40.0", "sass-loader": "^10.2.0", "standard-version": "^9.3.1", "stylelint": "^13.13.1", "stylelint-config-standard": "^22.0.0", - "stylelint-scss": "^3.20.1", + "stylelint-scss": "^3.21.0", "vue": "^2.6.14", "vue-template-compiler": "^2.6.14", "webpack": "^4.46.0" diff --git a/src/main/index.js b/src/main/index.js index f5f51005..f9b7721f 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -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); + }); }); } diff --git a/src/renderer/store/index.js b/src/renderer/store/index.js index a322ba49..510f5dba 100644 --- a/src/renderer/store/index.js +++ b/src/renderer/store/index.js @@ -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 ] }); diff --git a/src/renderer/store/plugins/ipcExceptions.js b/src/renderer/store/plugins/ipcExceptions.js new file mode 100644 index 00000000..b2209386 --- /dev/null +++ b/src/renderer/store/plugins/ipcExceptions.js @@ -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 }); + }); +};