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

Commit 1f9dbd4

Browse files
committed
修改 报错信息
1 parent 53705ba commit 1f9dbd4

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ export default class GeneralStartCommand extends InstanceCommand {
104104
const commandList = commandStringToArray(instance.config.startCommand);
105105
const commandExeFile = commandList[0];
106106
const commnadParameters = commandList.slice(1);
107+
if (commandList.length === 0) {
108+
return instance.failure(new StartupError("无法启动实例,启动命令为空"));
109+
}
107110

108111
logger.info("----------------");
109112
logger.info(`会话 ${source}: 请求开启实例.`);
@@ -122,10 +125,23 @@ export default class GeneralStartCommand extends InstanceCommand {
122125

123126
// 子进程创建结果检查
124127
if (!process || !process.pid) {
125-
throw new StartupError(`检测到实例进程/容器启动失败(PID 为空),其可能的原因是:
128+
instance.println(
129+
"ERROR",
130+
`检测到实例进程/容器启动失败(PID 为空),其可能的原因是:
126131
1. 实例启动命令编写错误,请前往实例设置界面检查启动命令与参数。
127-
2. 系统主机环境不正确或缺少环境,列如 Java 环境等。
128-
请将此信息报告给管理员或自行排查故障。`);
132+
2. 系统主机环境不正确或缺少环境,如 Java 环境等。
133+
134+
原生启动命令:
135+
${instance.config.startCommand}
136+
137+
启动命令解析体:
138+
程序:${commandExeFile}
139+
参数:${JSON.stringify(commnadParameters)}
140+
141+
请将此信息报告给管理员,技术人员或自行排查故障。
142+
`
143+
);
144+
throw new StartupError("实例启动失败,请检查启动命令,主机环境和配置文件等");
129145
}
130146

131147
// 创建进程适配器

0 commit comments

Comments
 (0)