This commit is contained in:
Killer Boss Original 2022-07-05 16:09:45 +02:00 committed by GitHub
parent d51ac60e14
commit 67730845a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View file

@ -4,6 +4,30 @@ client.config = require('./config.js').settings;
const MapDB = require('quickmap.db');
const db = new MapDB('database.json');
const chalk = require('chalk')
function catchError(message, err, origin, reason) {
console.log(chalk.gray('—————————————————————————————————'));
console.log(
chalk.white('['),
chalk.red.bold('AntiCrash'),
chalk.white(']'),
chalk.gray(' : '),
chalk.white.bold(message),
);
console.log(chalk.gray('—————————————————————————————————'));
console.log(err, origin, reason);
}
process.on('unhandledRejection', (err, origin) => {
catchError('Unhandled Rejection/Catch', err, origin);
});
process.on('uncaughtException', (err, origin) => {
catchError('Uncaught Exception/Catch', err, origin);
});
process.on('multipleResolves', (type, promise, reason) => {
catchError('Multiple Resolves', type, promise, reason);
});
async function setup() {
var isset = await db.get('client.issetupped')

View file

@ -3,6 +3,7 @@
"cors": "^2.8.5",
"express": "^4.18.1",
"fs": "^0.0.1-security",
"quickmap.db": "^1.1.1"
"quickmap.db": "^1.0.6",
"chalk": "^4.1.2"
}
}