Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 3435302

Browse files
committed
修改 错误提示文字
1 parent 5f38922 commit 3435302

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/entity/commands/general/general _start.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ export default class GeneralStartCommand extends InstanceCommand {
122122

123123
// 子进程创建结果检查
124124
if (!process || !process.pid) {
125-
throw new StartupError(`进程启动失败,进程PID为空,请检查启动命令和相关参数.`);
125+
throw new StartupError(`检测到实例进程/容器启动失败(PID 为空),其可能的原因是:
126+
1. 实例启动命令编写错误,请前往实例设置界面检查启动命令与参数。
127+
2. 系统主机环境不正确或缺少环境,列如 Java 环境等。
128+
请将此信息报告给管理员或自行排查故障。`);
126129
}
127130

128131
// 创建进程适配器

src/entity/instance/instance.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ export default class Instance extends EventEmitter {
227227
}
228228
this.config.eventTask.ignore = false;
229229
}
230+
231+
// 启动后瞬间关闭警告,一般是启动命令编写错误
232+
const currentTimestamp = new Date().getTime();
233+
const startThreshold = 3 * 1000;
234+
if (currentTimestamp - this.startTimestamp < startThreshold) {
235+
this.println("ERROR", `检测到实例启动后在极短的时间内退出,原因可能是您的启动命令错误或本地系统环境错误。`);
236+
}
230237
}
231238

232239
println(level: string, text: string) {

0 commit comments

Comments
 (0)