Skip to content
Merged
20 changes: 20 additions & 0 deletions src/platforms/node/guides/aws-lambda/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ exports.handler = Sentry.AWSLambda.wrapHandler(yourHandler, {
});
```


## Capture Rejected Promises in `Promise.allSettled`
_(New in version 6.14.3)_

By default, Sentry captures errors raised by your handler.
However, your handler might return a `Promise.allSettled` result.
In this case, even if one of the messages has failed, Sentry won't capture any exception.

The `captureAllSettledReasons` (default: `false`) option captures all promise rejected results

```javascript {tabTitle:captureAllSettledReasons}
exports.handler = Sentry.AWSLambda.wrapHandler(() => {
return Promise.allSettled([
Promise.rejected(new Error('first')),
Promise.rejected(new Error('second')),
]);
}, { captureAllSettledReasons: true });
// `first` and `second` errors are captured
```

## Behavior

With the AWS Lambda integration enabled, the Node SDK will:
Expand Down