diff --git a/CHANGELOG.md b/CHANGELOG.md index 056dd1ffb121..fd32edeee293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ If you want to manually add async context isolation to your application, you can import * as Sentry from '@sentry/node'; const requestHandler = (ctx, next) => { - return new Promise((resolve) => { + return new Promise((resolve, reject) => { Sentry.runWithAsyncContext(async () => { const hub = Sentry.getCurrentHub(); @@ -38,7 +38,11 @@ const requestHandler = (ctx, next) => { ) ); - await next(); + try { + await next(); + } catch (err) { + reject(err); + } resolve(); }); });