From 3f635694188bce6da0de80279372054edf77f6fe Mon Sep 17 00:00:00 2001 From: Rui Reogo <149220283+ruingl@users.noreply.github.com> Date: Sat, 4 May 2024 20:47:24 +0800 Subject: [PATCH] update: lessen logouts if got uncaughtException or unhandledRejection, just console.error it. and if got an error from bluebird about some forgotten return, it wont logout --- main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 67563955..70e92f88 100644 --- a/main.js +++ b/main.js @@ -1,3 +1,6 @@ +process.on('unhandledRejection', error => console.log(error)); +process.on('uncaughtException', error => console.log(error)); + const { readdirSync, readFileSync, writeFileSync } = require("fs-extra"); const { join, resolve } = require('path') const { execSync } = require('child_process'); @@ -13,6 +16,8 @@ const express = require('express'); const { spawn } = require("child_process"); const pkg = require('./package.json'); +process.env.BLUEBIRD_W_FORGOTTEN_RETURN = 0; + console.log(chalk.bold.dim(` ${process.env.REPL_SLUG}`.toUpperCase() + `(v${pkg.version})`)); logger.log(`Getting Started!`, "STARTER"); @@ -417,4 +422,4 @@ app.listen(2024, () => { /* * This bot was created by me (CATALIZCS) and my brother SPERMLORD. Do not steal my code. (つ ͡ ° ͜ʖ ͡° )つ ✄ ╰⋃╯ This file was modified by me (@YanMaglinte). Do not steal my credits. (つ ͡ ° ͜ʖ ͡° )つ ✄ ╰⋃╯ -* */ \ No newline at end of file +* */