Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-stepfunctions): add support to heartbeat error inside catch block #16078

Merged
merged 1 commit into from
Aug 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/@aws-cdk/aws-stepfunctions/README.md
Original file line number Diff line number Diff line change
@@ -555,6 +555,22 @@ new cloudwatch.Alarm(this, 'ThrottledAlarm', {
});
```

## Error names

Step Functions identifies errors in the Amazon States Language using case-sensitive strings, known as error names.
The Amazon States Language defines a set of built-in strings that name well-known errors, all beginning with the `States.` prefix.

* `States.ALL` - A wildcard that matches any known error name.
* `States.Runtime` - An execution failed due to some exception that could not be processed. 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 is not retriable, and will always cause the execution to fail. A retry or catch on `States.ALL` will NOT catch States.Runtime errors.
* `States.DataLimitExceeded` - A States.DataLimitExceeded exception will be thrown for the following:
diegotry marked this conversation as resolved.
Show resolved Hide resolved
* When the output of a connector is larger than payload size quota.
* When the output of a state is larger than payload size quota.
* When, after Parameters processing, the input of a state is larger than the payload size quota.
* See [the AWS documentation](https://docs.aws.amazon.com/step-functions/latest/dg/limits-overview.html) to learn more about AWS Step Functions Quotas.
* `States.HeartbeatTimeout` - A Task state failed to send a heartbeat for a period longer than the HeartbeatSeconds value.
* `States.Timeout` - A Task state either ran longer than the TimeoutSeconds value, or failed to send a heartbeat for a period longer than the HeartbeatSeconds value.
* `States.TaskFailed`- A Task state failed during the execution. When used in a retry or catch, `States.TaskFailed` acts as a wildcard that matches any known error name except for `States.Timeout`.

## Logging

Enable logging to CloudWatch by passing a logging configuration with a
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-stepfunctions/lib/types.ts
Original file line number Diff line number Diff line change
@@ -45,6 +45,11 @@ export class Errors {
*/
public static readonly ALL = 'States.ALL';

/**
* A Task State failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
*/
public static readonly HEARTBEAT_TIMEOUT = 'States.HeartbeatTimeout';

/**
* A Task State either ran longer than the “TimeoutSeconds” value, or
* failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-stepfunctions/package.json
Original file line number Diff line number Diff line change
@@ -105,6 +105,7 @@
"awslint": {
"exclude": [
"duration-prop-type:@aws-cdk/aws-stepfunctions.Errors.TIMEOUT",
"duration-prop-type:@aws-cdk/aws-stepfunctions.Errors.HEARTBEAT_TIMEOUT",
"no-unused-type:@aws-cdk/aws-stepfunctions.ServiceIntegrationPattern"
]
},