以下步骤函数在AWS中执行,当存在必需参数缺失时,它会取消流程并抛出States.Runtime错误。这是步骤函数的catch阶段,但它并没有如所述捕获错误。
定义的步骤函数如下:
以下是步骤函数:
下面是抛出的错误:
运行时错误未执行日志失败模块。
定义的步骤函数如下:
{
"StartAt": "Log Start Step Function",
"Comment": "Executed with inputs",
"States": {
"Log Start Step Function": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-1:0000000:function:update",
"Parameters": {
"body": {
"itemID.$": "$.itemID",
"functionName.$": "$.stepFunctionName ",
"executionARN.$": "$$.Execution.Id",
"complete": false,
"inprogress": true,
"error": false
}
},
"Catch": [
{
"ErrorEquals": [
"States.Runtime"
],
"ResultPath": "$.taskresult",
"Next": "Log Failed Module"
},
{
"ErrorEquals": [
"States.ALL"
],
"ResultPath": "$.taskresult",
"Next": "Log Failed Module"
}
],
"ResultPath": "$.taskresult",
"Next": "Evaluate Module PA1"
}
}
}
以下是步骤函数:
![enter image description here](https://istack.dev59.com/ft7RF.webp)
下面是抛出的错误:
![enter image description here](https://istack.dev59.com/yfBFk.webp)
运行时错误未执行日志失败模块。
{
"ErrorEquals": [
"States.Runtime"
],
"ResultPath": "$.taskresult",
"Next": "Log Failed Module"
},
这是AWS错误还是此处配置有误,或者有其他方法可以验证AWS Step Functions的参数?