|
1 | 1 | ---
|
2 |
| -# required metadata |
3 |
| -title: Error and exception handling - Azure Logic Apps | Microsoft Docs |
| 2 | +title: Error and exception handling - Azure Logic Apps |
4 | 3 | description: Learn about patterns for error and exception handling in Azure Logic Apps
|
5 | 4 | services: logic-apps
|
6 | 5 | ms.service: logic-apps
|
| 6 | +ms.suite: integration |
7 | 7 | author: dereklee
|
8 | 8 | ms.author: deli
|
9 |
| -manager: jeconnoc |
| 9 | +ms.reviewer: klam, estfan, LADocs |
10 | 10 | ms.date: 01/31/2018
|
11 | 11 | ms.topic: article
|
12 |
| - |
13 |
| -# optional metadata |
14 |
| -ms.reviewer: klam, LADocs |
15 |
| -ms.suite: integration |
16 | 12 | ---
|
17 | 13 |
|
18 | 14 | # Handle errors and exceptions in Azure Logic Apps
|
@@ -272,29 +268,17 @@ you can create a single action to catch failures.
|
272 | 268 |
|
273 | 269 | For limits on scopes, see [Limits and config](../logic-apps/logic-apps-limits-and-config.md).
|
274 | 270 |
|
| 271 | +<a name="get-results-from-failures"></a> |
| 272 | + |
275 | 273 | ### Get context and results for failures
|
276 | 274 |
|
277 |
| -Although catching failures from a scope is useful, |
278 |
| -you might also want context to help you understand |
279 |
| -exactly which actions failed plus any errors or status codes that were returned. |
280 |
| -The `@result()` expression provides context about the result of all actions in a scope. |
281 |
| - |
282 |
| -The `@result()` expression accepts a single parameter (the scope's name) |
283 |
| -and returns an array of all the action results from within that scope. |
284 |
| -These action objects include the same attributes as the **\@actions()** object, |
285 |
| -such as the action's start time, end time, status, inputs, correlation IDs, and outputs. |
286 |
| -To send context for any actions that failed within a scope, |
287 |
| -you can easily pair an **\@result()** function with a **runAfter** property. |
288 |
| - |
289 |
| -To run an action for each action in a scope that has a **Failed** result, |
290 |
| -and to filter the array of results down to the failed actions, |
291 |
| -you can pair **\@result()** with a **[Filter Array](../connectors/connectors-native-query.md)** action |
292 |
| -and a [**For each**](../logic-apps/logic-apps-control-flow-loops.md) loop. |
293 |
| -You can take the filtered result array and perform an action for each failure using the **For each** loop. |
294 |
| - |
295 |
| -Here's an example, followed by a detailed explanation, |
296 |
| -that sends an HTTP POST request with the response body |
297 |
| -for any actions that failed within the scope "My_Scope": |
| 275 | +Although catching failures from a scope is useful, you might also want context to help you understand exactly which actions failed plus any errors or status codes that were returned. |
| 276 | + |
| 277 | +The [`result()`](../logic-apps/workflow-definition-language-functions-reference.md#result) function provides context about the results from all the actions in a scope. The `result()` function accepts a single parameter, which is the scope's name, and returns an array that contains all the action results from within that scope. These action objects include the same attributes as the `@actions()` object, such as the action's start time, end time, status, inputs, correlation IDs, and outputs. To send context for any actions that failed within a scope, you can easily pair a `@result()` expression with the `runAfter` property. |
| 278 | + |
| 279 | +To run an action for each action in a scope that has a **Failed** result, and to filter the array of results down to the failed actions, you can pair a `@result()` expression with a [**Filter Array**](../connectors/connectors-native-query.md) action and a [**For each**](../logic-apps/logic-apps-control-flow-loops.md) loop. You can take the filtered result array and perform an action for each failure using the **For each** loop. |
| 280 | + |
| 281 | +Here's an example, followed by a detailed explanation, that sends an HTTP POST request with the response body for any actions that failed within the scope "My_Scope": |
298 | 282 |
|
299 | 283 | ```json
|
300 | 284 | "Filter_array": {
|
|
0 commit comments