Skip to content

Commit 05b22c7

Browse files
committed
Making requested changes [netlify-build] DOC-527
1 parent 7667648 commit 05b22c7

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

src/connections/functions/destination-functions.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,35 @@ The [Config API](/docs/config-api/) Functions/Preview endpoint also supports tes
291291

292292
### Handling batching errors
293293

294-
Standard [function error types](/docs/connections/functions/destination-functions/#destination-functions-error-types) apply to batch handlers. Segment attempts to retry the batch in the case of Timeout or Retry errors. For all other error types, Segment discards the batch.
294+
Standard [function error types](/docs/connections/functions/destination-functions/#destination-functions-error-types) apply to batch handlers. Segment attempts to retry the batch in the case of Timeout or Retry errors. For all other error types, Segment discards the batch. It is also possible to report a partial failure by returning status of each event in the batch. Segment retries only the failed events in a batch until those events are successful or until they result in a permanent error.
295+
296+
```json
297+
[
298+
{
299+
"status": 200
300+
},
301+
{
302+
"status": 400,
303+
"errormessage": "Bad Request"
304+
},
305+
{
306+
"status": 200
307+
},
308+
{
309+
"status": 500,
310+
"errormessage": "Error processing request"
311+
},
312+
{
313+
"status": 500,
314+
"errormessage": "Error processing request"
315+
},
316+
{
317+
"status": 200
318+
},
319+
]
320+
```
321+
322+
After receiving the response from the `onBatch` handler, only **event_3** and **event_4** will be retried.
295323

296324
| Error Type | Result |
297325
| ---------------------- | ------- |
@@ -302,7 +330,6 @@ Standard [function error types](/docs/connections/functions/destination-function
302330
| Timeout | Retry |
303331
| Unsupported Event Type | Discard |
304332

305-
If only part of a batch succeeds and the failed events return either a Timeout or Retry error, Segment retries only the failed events in a batch until those events are successful or until they result in a permanent error.
306333

307334
## Save and deploy the function
308335

0 commit comments

Comments
 (0)