Skip to content

Commit 72704e0

Browse files
committed
convert wrapped handler to named function in withSentry
1 parent b615b32 commit 72704e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/nextjs/src/utils/withSentry.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export type AugmentedNextApiResponse = NextApiResponse & {
4545
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4646
export const withSentry = (origHandler: NextApiHandler, parameterizedRoute?: string): WrappedNextApiHandler => {
4747
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
48-
return async (req, res) => {
48+
return async function sentryWrappedHandler(req: AugmentedNextApiRequest, res: NextApiResponse) {
4949
// We're now auto-wrapping API route handlers using `withSentryAPI` (which uses `withSentry` under the hood), but
5050
// users still may have their routes manually wrapped with `withSentry`. This check makes `sentryWrappedHandler`
5151
// idempotent so that those cases don't break anything.

0 commit comments

Comments
 (0)