Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Fixed a bug where the app would not fully quit after a crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZudoB committed Aug 1, 2018
1 parent 08436b3 commit 6e12d36
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 46 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Doki Doki Mod Manager!",
"description": "Mod Manager for Doki Doki Literature Club!",
"author": "Doki Doki Mod Manager! Development Team",
"version": "2.4.5",
"version": "2.4.6",
"homepage": "https://doki.space",
"main": "src/common/main.js",
"scripts": {
Expand Down
46 changes: 25 additions & 21 deletions src/common/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/common/main.js.map

Large diffs are not rendered by default.

49 changes: 26 additions & 23 deletions src/common/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,6 @@ registerProcessEventHandler("uncaughtException", (error) => {
appWin.hide();
}


dialog.showMessageBox({
buttons: ["Restart", "Quit"],
defaultId: 1,
detail: "A problem occurred in Doki Doki Mod Manager which caused the app to crash. " +
"A crash report has been generated, which will be helpful when fixing the issue.",
message: "Doki Doki Mod Manager crashed!",
type: "error",
}, (btn) => {
if (btn === 0) {
app.relaunch();
}
});

Logger.error("An uncaught exception occurred!");
Logger.error("Preparing to upload stacktrace...");

Expand All @@ -153,15 +139,32 @@ registerProcessEventHandler("uncaughtException", (error) => {
paste += "Error reading - " + e.message;
}

request({
headers: {
"User-Agent": "Doki Doki Mod Manager (u/zuudo)",
},
json: {
crash: paste,
},
method: "POST",
url: "https://us-central1-doki-doki-mod-manager.cloudfunctions.net/postCrashReport",
dialog.showMessageBox({
buttons: ["View Crash Report", "Quit"],
defaultId: 1,
detail: "A problem occurred in Doki Doki Mod Manager which caused the app to crash. " +
"A crash report has been generated, which will be helpful when fixing the issue.",
message: "Doki Doki Mod Manager crashed!",
type: "error",
}, (btn) => {
request({
headers: {
"User-Agent": "Doki Doki Mod Manager (u/zuudo)",
},
json: {
crash: paste,
},
method: "POST",
url: "https://us-central1-doki-doki-mod-manager.cloudfunctions.net/postCrashReport",
}, (e,r,b) => {
if (!e) {
if (btn === 0) {
shell.openExternal("https://gist.githubusercontent.com/ZudoMC/" + b + "/raw/crash.txt");
}
}

app.exit();
});
});
});

Expand Down

0 comments on commit 6e12d36

Please sign in to comment.