AWS Certified Developer – Associate — Question 31

A company is developing a report implemented using AWS Step Functions. Amazon CloudWatch shows errors in the Step Functions task state machine. To troubleshoot each task, the state input needs to be included along with the error message in the state output.
Which coding practice can preserve both the original input and the error for the state?

Answer options

Correct answer: A

Explanation

The correct answer is A, as using ResultPath in a Catch statement allows you to include the error alongside the original input, which is essential for effective troubleshooting. Options B and D do not retain the input, and option C is incorrectly focused on Retry statements, which do not apply in this context.