fix appcenter log upload error

This commit is contained in:
HolographicHat
2022-04-09 19:33:52 +08:00
parent 1e15a49667
commit 60f0d8d23b
3 changed files with 27 additions and 10 deletions

8
app.js
View File

@@ -17,18 +17,18 @@ const onExit = () => {
(async () => {
try {
process.once("SIGHUP", () => setupHost(true))
process.on("SIGHUP", () => setupHost(true))
process.on("unhandledRejection", (reason, promise) => {
console.log("Unhandled Rejection at: ", promise, "\n0Reason:", reason)
})
process.once("uncaughtException", (err, origin) => {
process.on("uncaughtException", (err, origin) => {
appcenter.uploadError(err, true)
console.log(err)
console.log(`Origin: ${origin}`)
process.exit(1)
})
process.once("exit", onExit)
process.once("SIGINT", onExit)
process.on("exit", onExit)
process.on("SIGINT", onExit)
try {
enablePrivilege()
} catch (e) {