Skip to content

Commit 7c37ba5

Browse files
committed
error passing to main
1 parent 8ff0943 commit 7c37ba5

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ function createWindow() {
172172
}
173173
}
174174

175+
// Error in Renderer
176+
ipcMain.on('errorInWindow', async (event, error) => {
177+
log.error('Window error', error)
178+
})
179+
175180
// Actions
176181

177182
ipcMain.on('login-attempt', async (event, loginEmailPw) => {

src/components/Home.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class Home extends React.Component {
3030

3131
componentDidMount() {
3232

33+
window.onerror = function(error, url, line) {
34+
ipcRenderer.send('errorInWindow', error);
35+
};
36+
3337
window.addEventListener('online', this.alertOnlineStatus)
3438
window.addEventListener('offline', this.alertOnlineStatus)
3539

0 commit comments

Comments
 (0)