perf: 前置任务步骤增加错误提示

pull/189/head
xiaojunnuo 2024-09-09 09:27:38 +08:00
parent 01df4d0f1d
commit ae3daa9bcf
1 changed files with 6 additions and 0 deletions

View File

@ -217,11 +217,17 @@ export class Executor {
if (item.component?.name === "pi-output-selector") {
const contextKey = input[key];
if (contextKey != null) {
if (typeof contextKey !== "string") {
throw new Error(`步骤${step.title}${item.title}属性必须为String类型请重新配置该属性`);
}
// "cert": "step.-BNFVPMKPu2O-i9NiOQxP.cert",
const arr = contextKey.split(".");
const id = arr[1];
const outputKey = arr[2];
input[key] = this.currentStatusMap.get(id)?.status?.output[outputKey] ?? this.lastStatusMap.get(id)?.status?.output[outputKey];
if (input[key] == null) {
this.logger.warn(`${item.title}的配置未找到对应的输出值,请确认对应的前置任务是否存在或者是否执行正确`);
}
}
}
});