Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AWS step function stops executing instead of catch

Why is does my step function stop executing instead of following the Catch #1 path?

Studio

Case

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Because you cannot catch States.Runtime errors. The docs state

States.Runtime
An execution failed due to some exception that it couldn’t process. Often these are caused by errors at runtime, such as attempting to apply InputPath or OutputPath on a null JSON payload. A States.Runtime error isn’t retriable, and will always cause the execution to fail. A retry or catch on States.ALL won’t catch States.Runtime errors.

You tried accessing FaceDetails[0]... but there aren’t any FaceDetails in your state.

Instead of catching this error you should put a Choice state after the DetectFace to determine whether you actually found a face and only then forward that face detection to the lambda. You can use a IsPresent check for $.FaceDetails[0]: https://stackoverflow.com/a/65693332/2442804 .

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading