From f553260b56a77615917297750fdeebc17f7ab0c8 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Sat, 9 Sep 2023 14:13:22 -0300 Subject: [PATCH] fix(all): Fix user switching on a single chip. --- src/app.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app.ts b/src/app.ts index bd631062..52d2a547 100644 --- a/src/app.ts +++ b/src/app.ts @@ -60,6 +60,7 @@ import { RootData } from './RootData.js'; import { GBSSR } from '../packages/core.gbapp/services/GBSSR.js'; import { Mutex } from 'async-mutex'; import { GBVMService } from '../packages/basic.gblib/services/GBVMService.js'; +import e from 'express'; /** * General Bots open-core entry point. @@ -108,6 +109,7 @@ export class GBServer { // Setups global error handlers. process.on('unhandledRejection', (err, p) => { + err = err['e'] ? err['e'] : err; GBLog.error(`UNHANDLED_REJECTION(promises): ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''}`); if (err['response']?.obj?.httpStatusCode === 404) { GBLog.warn(`Check reverse proxy: ${process.env.BOT_URL} as it seems to be invalid.`); @@ -116,6 +118,7 @@ export class GBServer { process.on('uncaughtException', (err, p) => { if (err !== null) { + err = err['e'] ? err['e'] : err; GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''}`); } else { GBLog.error('UNCAUGHT_EXCEPTION: Unknown error (err is null)');