totherik / step

An Amazon States Language implementation in JS. (The beginnings of building out FaaS-agnostic Step Functions.)
53 stars 9 forks source link

Task Catch/Error Handling #3

Open totherik opened 7 years ago

totherik commented 7 years ago

When a Task is executed the Resource returns information as to the nature of the failure. According to the specification any error that is transferred to another state is an Error Output type containing an "Error Name" (named "Error") and optional "Cause" property.

When a state reports an error and it matches a Catcher, causing a transfer to another state, the state’s result (and thus the input to the state identified in the Catcher’s “Next” field) is a JSON object, called the Error Output. The Error Output MUST have a string-valued field named “Error”, containing the Error Name. It SHOULD have a string-valued field named “Cause”, containing human-readable text about the error.

So, if a Catcher has a ResultPath and can pluck the appropriately-formatted Error Output from the Result, everything is fine as long as the returned resource conforms to the Error Output specification. What's not clear is how to map the Task result to Error Output if no ResultPath is defined.

This needs to be codified and implemented.