From 0a2a6588daeb8f726e3527dbcecabe66cbf7b018 Mon Sep 17 00:00:00 2001 From: Suwings Date: Wed, 4 Mar 2020 18:28:31 +0800 Subject: [PATCH] Test --- app.js | 5 +++++ core/Process/BaseMcserver.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index c638805..6f40f76 100644 --- a/app.js +++ b/app.js @@ -192,6 +192,11 @@ process.on("uncaughtException", function (err) { MCSERVER.error('错误报告:', err); }); +process.on('unhandledRejection', (reason, p) => { + MCSERVER.infoLog('错误报告:'); + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); +}); + //初始化目录结构环境 (function initializationRun() { const USERS_PATH = './users/'; diff --git a/core/Process/BaseMcserver.js b/core/Process/BaseMcserver.js index 16d2d02..049f7da 100644 --- a/core/Process/BaseMcserver.js +++ b/core/Process/BaseMcserver.js @@ -272,7 +272,10 @@ class ServerProcess extends EventEmitter { if (this.dataModel.dockerConfig.isDocker) { // Docker 启动 // 选用虚拟化技术启动后,将不再执行下面代码逻辑,由专属的进程启动方式启动。 - this.dockerStart(); + this.dockerStart().catch((err) => { + this.printlnCommandLine("进程实例启动时失败,建议检查配置文件与启动参数"); + this.stop(); + }); // 阻止继续运行下去 return true; } else {