Add error handling to SIGUSR1 power button handler

This commit is contained in:
Claude
2025-12-28 15:58:13 +00:00
parent 7ed5faa2dc
commit 27de108579
+10 -2
View File
@@ -5531,8 +5531,16 @@ if(!app.requestSingleInstanceLock())app.quit();
// Handle SIGUSR1 from power button trigger script
process.on('SIGUSR1',()=>{
console.log('[POWER] Received SIGUSR1 signal - showing power menu');
showPowerMenu();
console.log('[POWER] Received SIGUSR1 signal');
try{
if(mainWindow&&!mainWindow.isDestroyed()){
showPowerMenu();
}else{
console.log('[POWER] mainWindow not ready');
}
}catch(e){
console.error('[POWER] Error:',e.message);
}
});
app.on('certificate-error',(e,w,u,er,c,cb)=>{