File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/platforms/node/guides/aws-lambda Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,26 @@ exports.handler = Sentry.AWSLambda.wrapHandler(yourHandler, {
80
80
} );
81
81
```
82
82
83
+
84
+ ## Capture Rejected Promises in `Promise.allSettled`
85
+ _(New in version 6.14.3)_
86
+
87
+ By default, Sentry captures errors raised by your handler.
88
+ However, your handler might return a `Promise.allSettled` result.
89
+ In this case, even if one of the messages has failed, Sentry won't capture any exception.
90
+
91
+ The `captureAllSettledReasons` (default: `false`) option captures all promise rejected results
92
+
93
+ ```javascript { tabTitle :captureAllSettledReasons }
94
+ exports.handler = Sentry.AWSLambda.wrapHandler(() => {
95
+ return Promise .allSettled ([
96
+ Promise .rejected (new Error (' first' )),
97
+ Promise .rejected (new Error (' second' )),
98
+ ]);
99
+ } , { captureAllSettledReasons : true } );
100
+ // `first` and `second` errors are captured
101
+ ```
102
+
83
103
## Behavior
84
104
85
105
With the AWS Lambda integration enabled, the Node SDK will:
You can’t perform that action at this time.
0 commit comments