map failure page to error code if any, when Script run when task failed (#4149)

This commit is contained in:
Shuchang Zheng
2025-11-30 17:34:48 -08:00
committed by GitHub
parent 9d44997584
commit 76a61d23e6
3 changed files with 1666 additions and 1442 deletions

View File

@@ -1676,6 +1676,20 @@ def __build_base_task_statement(
),
)
)
# Add error_code_mapping if it exists
if block.get("error_code_mapping") is not None:
args.append(
cst.Arg(
keyword=cst.Name("error_code_mapping"),
value=_value(block.get("error_code_mapping")),
whitespace_after_arg=cst.ParenthesizedWhitespace(
indent=True,
last_line=cst.SimpleWhitespace(INDENT),
),
)
)
if block.get("block_type") == "task_v2":
args.append(
cst.Arg(