Skip to content

Commit 9f1b50d

Browse files
committed
Update Generic Error Handling Step
1 parent ac43744 commit 9f1b50d

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed
45.5 KB
Loading

articles/data-factory/tutorial-pipeline-failure-error-handling.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ In some cases, you may want to invoke a shared error handling or logging step, i
134134
```json
135135
@or(equals(activity('ActivityFailed').Status, 'Failed'), equals(activity('ActivitySucceeded').Status, 'Failed'))
136136
```
137-
* Note: you need concatenated or if you've more than two dependency activities, for instance,
137+
* Note: you need concatenated or if you have more than two dependency activities, for instance,
138138
```json
139139
@or(or(equals(activity('ActivityFailed').Status, 'Failed'), equals(activity('ActivitySucceeded1').Status, 'Failed')),equals(activity('ActivitySucceeded1').Status, 'Failed'))
140140
```
@@ -167,16 +167,34 @@ The pattern is a combination of two: conditional and + error handling. The pipel
167167

168168
:::image type="content" source="media/tutorial-pipeline-failure-error-handling/conditional-complex-1.png" alt-text="Screenshot showcasing pipeline proceeds to next step if any of the activities pass, or else runs error handling code.":::
169169

170+
## Common Patterns
170171

171172
### Try-Catch-Proceed
172-
The pattern is equivalent to try catch block in coding. It states that if either the activity or the error handling code succeeds, the pipeline should proceed. We've simplified and streamlined the implementation for our customers. Try catch block doesn't need an if block.
173+
The pattern is equivalent to try catch block in coding. An activity might fail in a pipeline. When it fails, customer needs to run an error handling job to deal with it. However, the single activity failure shouldn't block next activities in the pipeline. For instance, I attempt to run a copy job, moving files into storage. However it might fail half way through. And in that case, I want to delete the partially copied, unreliable files from the storage account (my error handling step). But I'm OK to proceed with other activities afterwards.
174+
175+
To set up the pattern:
173176

174177
* Add first activity
175178
* Add error handling to the UponFailure path
176179
* Add second activity, but don't connect to the first activity
177180
* Connect both UponFailure and UponSkip paths from the error handling activity to the second activity
178181

179-
:::image type="content" source="media/tutorial-pipeline-failure-error-handling/conditional-complex-2.png" alt-text="Screenshot showcasing pipeline with try catch block.":::
182+
:::image type="content" source="media/tutorial-pipeline-failure-error-handling/error-handling-1-try-catch.png" alt-text="Screenshot showcasing pipeline with try catch block.":::
183+
184+
Error Handling job runs only when First Activity fails. Next Activity will run regardless if First Activity succeeds or not.
185+
186+
### Generic Error Handling
187+
Commonly, we have multiple activities running sequentially in the pipeline. If any fails, I need to run an error handling job to clear the state, and/or log the error. For instance, I have sequential copy activities in the pipeline. If any of these fails, I need to run a script job to log the pipeline failure.
188+
189+
To set up the pattern:
190+
191+
* Build sequential data processing pipeline
192+
* Add generic error handling step to the end of the pipeline
193+
* Connect both UponFailure and UponSkip paths from the last activity to the error handling activity
194+
195+
:::image type="content" source="media/tutorial-pipeline-failure-error-handling/error-handling-2-generic-no-branching.png" alt-text="Screenshot showcasing pipeline with generic error handling in a pipeline with no branching.":::
196+
197+
The last step, Generic Error Handling, will only run if any of the previous activities fails. It will not run if they all succeed.
180198

181199
## Next steps
182200

0 commit comments

Comments
 (0)