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}`, + ) +})