Skip to content

Commit

Permalink
convert wrapped handler to named function in withSentry
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Sep 23, 2022
1 parent a27f69f commit 712a3e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nextjs/src/utils/withSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type AugmentedNextApiResponse = NextApiResponse & {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const withSentry = (origHandler: NextApiHandler, parameterizedRoute?: string): WrappedNextApiHandler => {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
return async (req, res) => {
return async function sentryWrappedHandler(req: AugmentedNextApiRequest, res: NextApiResponse) {
// We're now auto-wrapping API route handlers using `withSentryAPI` (which uses `withSentry` under the hood), but
// users still may have their routes manually wrapped with `withSentry`. This check makes `sentryWrappedHandler`
// idempotent so that those cases don't break anything.
Expand Down

0 comments on commit 712a3e7

Please sign in to comment.