课程: AWS for Developers: Step Functions

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Solution: Error handling

Solution: Error handling

(upbeat music) - [Instructor] All right, guys, let's take a look at the solutions for this challenge. We have a two-part solution. We're looking right now at the Lambda, and then we're going to look at the state machine changes. So starting with the Lambda, first thing we do here is capture the input data that we're going to use. In this case length, width, and height, which is provided in the volume section of our input document. We just put this in three variables here on line 13, 14, and 15. Once we have that data, we make our calculation on line 18, just a simple multiply here to get cubic inches. Now, since we're trying to test error handling in this particular challenge, I have these two variable, A and B, five and zero, and I'm going to make a division here on line 25, but I'm only going to make that division about 10% of the times that you call this function. That's why I have line 24, which is a random number…

内容