aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-05-30 00:50:52 -0500
committermat <github@matdoes.dev>2021-05-30 00:50:52 -0500
commit9ce197d8c677c08e6bef436a1a1c7c6f7cdb443a (patch)
treee0a2b4dab743ae75d1d8db4c1a17c25aed4f0f1e
parent776a3ab5f6d717d88691044732d2a9d00f1ca772 (diff)
downloadskyblock-api-9ce197d8c677c08e6bef436a1a1c7c6f7cdb443a.tar.gz
skyblock-api-9ce197d8c677c08e6bef436a1a1c7c6f7cdb443a.tar.bz2
skyblock-api-9ce197d8c677c08e6bef436a1a1c7c6f7cdb443a.zip
do more things to maybe prevent random crashes???
-rw-r--r--build/index.js2
-rw-r--r--src/index.ts3
2 files changed, 5 insertions, 0 deletions
diff --git a/build/index.js b/build/index.js
index 70d11d0..a799d2a 100644
--- a/build/index.js
+++ b/build/index.js
@@ -163,6 +163,8 @@ app.post('/accounts/update', async (req, res) => {
res.json({ ok: false });
}
});
+process.on('uncaughtException', err => console.error(err));
+process.on('unhandledRejection', (err, promise) => console.error(promise, err));
// only run the server if it's not doing tests
if (!globalThis.isTest)
app.listen(8080, () => console.log('App started :)'));
diff --git a/src/index.ts b/src/index.ts
index fe6ea90..642e9b3 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -162,6 +162,9 @@ app.post('/accounts/update', async(req, res) => {
}
})
+process.on('uncaughtException', err => console.error(err))
+process.on('unhandledRejection', (err, promise) => console.error(promise, err))
+
// only run the server if it's not doing tests
if (!globalThis.isTest)
app.listen(8080, () => console.log('App started :)'))