From 5caf86fd58f54331ce555636a34af75f6f3730fb Mon Sep 17 00:00:00 2001 From: Bingus_Violet Date: Wed, 29 Nov 2023 22:07:10 -0600 Subject: [PATCH] errors! --- index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 61db0ca..0aab824 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +const fs = require('fs') + var updateTime = (process.env.UPDATE_TIME || 30) const clientId = process.env.CLIENT_ID @@ -73,4 +75,12 @@ function update() { client.on('ready', () => { update() -}); \ No newline at end of file +}); + +process.on('uncaughtException', (err, origin) => { + fs.writeSync( + process.stderr.fd, + `Caught exception: ${err}\n` + + `Exception origin: ${origin}`, + ) +})