diff --git a/src/platforms/node/guides/aws-lambda/index.mdx b/src/platforms/node/guides/aws-lambda/index.mdx index b80e3ee1782344..d3076e1e777845 100644 --- a/src/platforms/node/guides/aws-lambda/index.mdx +++ b/src/platforms/node/guides/aws-lambda/index.mdx @@ -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: