下面的 step 函数在 aws 中执行,当缺少必需的参数时,它会取消流程并抛出 States.Runtime 错误。这是在 step 函数的 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"
}
}
}
下面是阶跃函数,
抛出的错误如下,
运行时错误未执行记录失败的模块。
{
"ErrorEquals": [
"States.Runtime"
],
"ResultPath": "$.taskresult",
"Next": "Log Failed Module"
},
这是 AWS 错误还是此处完成的配置有问题,或者是否有任何其他方法可以验证 AWS Step Functions 中的参数
最佳答案
来自 https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
A States.Runtime error is not retriable, and will always cause the execution to fail. A retry or catch on States.ALL will not catch States.Runtime errors.
关于amazon-web-services - AWS Step Functions 未捕获 States.Runtime 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62340479/