You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide.md
+32-34Lines changed: 32 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,9 +57,9 @@ Any state can encounter runtime errors. Errors can arise because of state machin
57
57
```json
58
58
"Catch": [
59
59
{
60
-
"ErrorEquals": ["ErrProcessOrder"],
61
-
"ResultPath": "$.error",
62
-
"Next": "UpdateOrderStatus"
60
+
"ErrorEquals": ["ErrProcessOrder"],
61
+
"ResultPath": "$.error",
62
+
"Next": "UpdateOrderStatus"
63
63
}
64
64
]
65
65
```
@@ -84,7 +84,32 @@ When a state reports an error, the interpreter scans through the Retriers and, w
84
84
]
85
85
```
86
86
87
-
## Invoking your Step Function via CLI
87
+
## Custom Errors
88
+
89
+
The following is a list of all the custom errors thrown by the application and can be used in your state machine.
90
+
91
+
*`ErrProcessOrder` represents a process order error
92
+
*`ErrUpdateOrderStatus` represents a process order error
93
+
*`ErrProcessPayment` represents a process payment error
94
+
*`ErrProcessRefund` represents a process payment refund error
95
+
*`ErrReserveInventory` represents a inventory update error
96
+
*`ErrReleaseInventory` represents a inventory update reversal error
97
+
98
+
## Testing Scenarios
99
+
100
+
The AWS Step Functions implementation has been configured for you to be easily test the various scenarios of the saga implementation. Modifying your `order_id` with a specified prefix will trigger an error in the each Task.
101
+
102
+
OrderID Prefix | Will error with | Example | Expected execution
4-9 | No error | 47063fe3-56d9-4c51-b91f-71929834ce03 | 
111
+
112
+
### Invoking your Step Function via CLI
88
113
89
114
The AWS CLI command will trigger a execution of your state machine. Make sure you substitute the ARN for the state machine in your account. You can find the ARN in the AWS CloudFormation Output section or in the AWS Step Functions console.
90
115
@@ -95,47 +120,20 @@ The AWS CLI command will trigger a execution of your state machine. Make sure yo
***ErrProcessOrder** represents a process order error
107
-
***ErrUpdateOrderStatus** represents a process order error
108
-
***ErrProcessPayment** represents a process payment error
109
-
***ErrProcessRefund** represents a process payment refund error
110
-
***ErrReserveInventory** represents a inventory update error
111
-
***ErrReleaseInventory** represents a inventory update reversal error
112
-
113
-
## Testing Scenarios
114
-
115
-
The AWS Step Functions implementation has been configured for you to be easily test the various scenarios of the saga implementation. Modifying your `order_id` with a specified prefix will trigger an error in the each Task.
116
-
117
-
OrderID Prefix | Will error with | Example | Expected execution
*[Amazon States Language](https://states-language.net/spec.html)
137
136
138
-
139
137
## How else can you implement this solution?
140
138
141
139
Is there any other way you can think of how to break this problem down? What other features of Step Functions could be employed to implement a saga pattern?
0 commit comments