for (const step of run.data.steps) {
if (step.warnings?.length) console.warn(step.id, step.warnings);
}for step in run.data["steps"]:
if step.get("warnings"):
print(step["id"], step["warnings"])是什么产生一个
| 情况情况 | 通常 |
|---|---|
| 剪切了结果 | 返回的一步比运兵带还多。 |
| 值不是预期的形状 | 模板读取了一些不存在的东西。 |
| 部分答答服务 | 部分工作已经完成。 |
| 环境没有兑现 | 要求的一步是服务无法做到的东西 。 |
警告是解释后来失败的原因
剪切出输出成功的一步; 一步读取它后两步失败的一步, 其值不在此。 读取警告是它如何成为一个问题而不是两个。
冲冲时表面表面
const problems = run.data.steps
.filter((s) => s.warnings?.length)
.map((s) => `${s.id}: ${s.warnings.join("; ")}`);
if (problems.length) notify(problems);problems = [f"{s['id']}: {'; '.join(s['warnings'])}" for s in run.data["steps"] if s.get("warnings")]
if problems:
notify(problems)运行Stenep () 也报告它们
试验步骤在链条部署之前显示其警告——这是最廉价的注意地点。
并非错误
error 是一个失败的步骤。 warnings 是一个有效且有保留的步骤。 将一个作为另一个处理, 使运行看起来崩溃或使一个真正的问题隐形。