java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.Errors
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-22T22:42:58.797Z") @Stability(Stable) public class Errors extends software.amazon.jsii.JsiiObject
Predefined error strings Error names in Amazon States Language - https://states-language.net/spec.html#appendix-a Error handling in Step Functions - https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html.

Example:

 import software.amazon.awscdk.services.dynamodb.*;
 // create a table
 Table table = Table.Builder.create(this, "montable")
         .partitionKey(Attribute.builder()
                 .name("id")
                 .type(AttributeType.STRING)
                 .build())
         .build();
 Pass finalStatus = new Pass(this, "final step");
 // States language JSON to put an item into DynamoDB
 // snippet generated from https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-code-snippet.html#tutorial-code-snippet-1
 Map<String, Object> stateJson = Map.of(
         "Type", "Task",
         "Resource", "arn:aws:states:::dynamodb:putItem",
         "Parameters", Map.of(
                 "TableName", table.getTableName(),
                 "Item", Map.of(
                         "id", Map.of(
                                 "S", "MyEntry"))),
         "ResultPath", null);
 // custom state which represents a task to insert data into DynamoDB
 CustomState custom = CustomState.Builder.create(this, "my custom task")
         .stateJson(stateJson)
         .build();
 // catch errors with addCatch
 Pass errorHandler = new Pass(this, "handle failure");
 custom.addCatch(errorHandler);
 // retry the task if something goes wrong
 custom.addRetry(RetryProps.builder()
         .errors(List.of(Errors.ALL))
         .interval(Duration.seconds(10))
         .maxAttempts(5)
         .build());
 Chain chain = Chain.start(custom).next(finalStatus);
 StateMachine sm = StateMachine.Builder.create(this, "StateMachine")
         .definitionBody(DefinitionBody.fromChainable(chain))
         .timeout(Duration.seconds(30))
         .comment("a super cool state machine")
         .build();
 // don't forget permissions. You need to assign them
 table.grantWriteData(sm);
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Matches any Error.
    static final String
    A branch of a Parallel state failed.
    static final String
    A Task State failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
    static final String
    A Choice state failed to find a match for the condition field extracted from its input.
    static final String
    Within a state’s “Parameters” field, the attempt to replace a field whose name ends in “.$” using a Path failed.
    static final String
    A Task State failed because it had insufficient privileges to execute the specified code.
    static final String
    A Task State’s “ResultPath” field cannot be applied to the input the state received.
    static final String
    A Task State failed during the execution.
    static final String
    A Task State either ran longer than the “TimeoutSeconds” value, or failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
     
    protected
    Errors(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Errors(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • ALL

      @Stability(Stable) public static final String ALL
      Matches any Error.
    • BRANCH_FAILED

      @Stability(Stable) public static final String BRANCH_FAILED
      A branch of a Parallel state failed.
    • HEARTBEAT_TIMEOUT

      @Stability(Stable) public static final String HEARTBEAT_TIMEOUT
      A Task State failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
    • NO_CHOICE_MATCHED

      @Stability(Stable) public static final String NO_CHOICE_MATCHED
      A Choice state failed to find a match for the condition field extracted from its input.
    • PARAMETER_PATH_FAILURE

      @Stability(Stable) public static final String PARAMETER_PATH_FAILURE
      Within a state’s “Parameters” field, the attempt to replace a field whose name ends in “.$” using a Path failed.
    • PERMISSIONS

      @Stability(Stable) public static final String PERMISSIONS
      A Task State failed because it had insufficient privileges to execute the specified code.
    • RESULT_PATH_MATCH_FAILURE

      @Stability(Stable) public static final String RESULT_PATH_MATCH_FAILURE
      A Task State’s “ResultPath” field cannot be applied to the input the state received.
    • TASKS_FAILED

      @Stability(Stable) public static final String TASKS_FAILED
      A Task State failed during the execution.
    • TIMEOUT

      @Stability(Stable) public static final String TIMEOUT
      A Task State either ran longer than the “TimeoutSeconds” value, or failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
  • Constructor Details

    • Errors

      protected Errors(software.amazon.jsii.JsiiObjectRef objRef)
    • Errors

      protected Errors(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Errors

      @Stability(Stable) public Errors()