[MM-50011] Disable popping the dialog box for uncaught exceptions (#2519)

This commit is contained in:
Devin Binnie 2023-01-27 09:05:32 -05:00 committed by GitHub
parent 59c98036ee
commit cf6611cc87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View file

@ -60,7 +60,7 @@ async function toggleDarkMode() {
robot.keyTap('enter');
robot.keyTap('v');
robot.keyTap('t');
await asyncSleep(500); // Add a sleep because sometimes the second 't' doesn't fire
await asyncSleep(500); // Add a sleep because sometimes the second 't' doesn't fire
robot.keyTap('t'); // Click on "Toggle Dark Mode" menu item
robot.keyTap('enter');
}

View file

@ -46,8 +46,8 @@
"test:e2e:build": "webpack-cli --config webpack.config.test.js",
"test:e2e:run": "electron-mocha -r @babel/register --reporter mochawesome dist/tests/e2e_bundle.js",
"test:e2e:send-report": "node ./e2e/save_report.js",
"test:unit": "jest",
"test:unit-ci": "jest --runInBand",
"test:unit": "cross-env NODE_ENV=jest jest",
"test:unit-ci": "cross-env NODE_ENV=jest jest --runInBand",
"test:coverage": "jest --coverage",
"package:all": "cross-env NODE_ENV=production npm-run-all package:windows package:windows-nsis package:mac package:mac-with-universal package:linux",
"package:windows": "npm-run-all build-prod && electron-builder --win zip --x64 --ia32 --arm64 --publish=never",

View file

@ -68,6 +68,10 @@ export class CriticalErrorHandler {
const report = createErrorReport(err);
fs.writeFileSync(file, report.replace(new RegExp('\\n', 'g'), os.EOL));
if (process.env.NODE_ENV === 'test') {
return;
}
if (app.isReady()) {
const buttons = [
localizeMessage('main.CriticalErrorHandler.uncaughtException.button.showDetails', 'Show Details'),