课程: AWS for Developers: Step Functions
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Catching errors and handling retries - Amazon Web Services (AWS)教程
课程: AWS for Developers: Step Functions
Catching errors and handling retries
- Now that we know about timeouts and the standard error names, let's talk about error handling. And we're going to start by talking about retries. One of the great advantage of using step functions is that you don't have to code retry logic. You just add this little bit of code here and you automatically have retry logic to handle errors. So if we look at this, we have the first line, this says error equals, and we can specify in here, any error that we're looking for, and this example is stay stuck timeout. Meaning that if the function call takes too long and exceeds the time threshold, we trigger this condition, and this condition says, wait for three seconds, that's the interval seconds attribute. And then you're going to attempt twice more to see if it works. That's defined by the max attempt keyword here. Now, if you retry and fail and you go to a second attempt, I want you to back off by 1.5. So in this case, the…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。