Skip to content

Commit d5e9165

Browse files
committed
s/handler/origHandler
1 parent e97cf36 commit d5e9165

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/nextjs/src/utils/withSentry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type WrappedNextApiHandler = NextApiHandler;
1313
type AugmentedResponse = NextApiResponse & { __sentryTransaction?: Transaction };
1414

1515
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
16-
export const withSentry = (handler: NextApiHandler): WrappedNextApiHandler => {
16+
export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler => {
1717
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1818
return async (req, res) => {
1919
// first order of business: monkeypatch `res.end()` so that it will wait for us to send events to sentry before it
@@ -74,7 +74,7 @@ export const withSentry = (handler: NextApiHandler): WrappedNextApiHandler => {
7474
}
7575

7676
try {
77-
return await handler(req, res); // Call original handler
77+
return await origHandler(req, res);
7878
} catch (e) {
7979
if (currentScope) {
8080
currentScope.addEventProcessor(event => {

0 commit comments

Comments
 (0)