In Electronjs You Need A Crash Report Methods To Debug Your Application And Cath Errors And Crashes
So Read This Tips :
Documentation For Electron Crash Reporter : Electron | crashReporter
- crashReporter doesn't catch renderer process crashes no matter where you start it (main or renderer process
- Using Window Event Like The window.onerror
- Render Process :
window.onerror = function(msg, url, line, col, error) {
let error_message = {
message:msg,
url_file:url,
line_code:line,
column:col,
error:error,
}
//send The Error To Main Process
ipc.send("error",error_message)
}
- Main Process :
ipc.on("error",(event,error)=>{
console.log(error);
})
- render-process-gone Event Web Contents Event :
mainWindow.webContents.on('render-process-gone',(event ,details )=>{
console.log(details);
})