Skip to content

Commit 3b3c5bd

Browse files
author
Luca Forstner
authored
meta: Update changelog to incorporate #7849 and #7850 (#7851)
1 parent d54ff78 commit 3b3c5bd

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

CHANGELOG.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,26 @@ This release switches the SDK to use [`AsyncLocalStorage`](https://nodejs.org/ap
2222
If you want to manually add async context isolation to your application, you can use the new `runWithAsyncContext` API.
2323

2424
```js
25+
import * as Sentry from '@sentry/node';
26+
2527
const requestHandler = (ctx, next) => {
2628
return new Promise((resolve, reject) => {
27-
Sentry.runWithAsyncContext(
28-
async hub => {
29-
hub.configureScope(scope =>
30-
scope.addEventProcessor(event =>
31-
Sentry.addRequestDataToEvent(event, ctx.request, {
32-
include: {
33-
user: false,
34-
},
35-
})
36-
)
37-
);
38-
39-
await next();
40-
resolve();
41-
},
42-
{ emitters: [ctx] }
43-
);
29+
Sentry.runWithAsyncContext(async () => {
30+
const hub = Sentry.geCurrentHub();
31+
32+
hub.configureScope(scope =>
33+
scope.addEventProcessor(event =>
34+
Sentry.addRequestDataToEvent(event, ctx.request, {
35+
include: {
36+
user: false,
37+
},
38+
})
39+
)
40+
);
41+
42+
await next();
43+
resolve();
44+
});
4445
});
4546
};
4647
```

0 commit comments

Comments
 (0)