We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 237cf9f commit f7a4846Copy full SHA for f7a4846
packages/nextjs/src/utils/withSentry.ts
@@ -179,6 +179,10 @@ export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler =
179
// a promise here rather than a real result, and it saves us the overhead of an `await` call.)
180
return boundHandler();
181
};
182
+
183
+ // Flag the original handler as already having been wrapped, to prevent it from being wrapped twice (which it could
184
+ // be, if someone has already wrapped it manually and then we come along and auto-wrap it)
185
+ wrappedHandler.__sentry_wrapped__ = true;
186
187
188
type ResponseEndMethod = AugmentedNextApiResponse['end'];
0 commit comments