process.on('uncaughtException', (err) => { log.error('[main] uncaughtException', err); }); process.on('unhandledRejection', (reason) => { log.error('[main] unhandledRejection', reason); }); const { crashReporter } = require('electron'); crashReporter.start({ productName: 'MyApp', companyName: 'MyCompany', submitURL: 'https://example.com/crash', uploadToServer: false, // 先落本地,确认稳定再上传 compress: true });