Skip to content

Commit 1c1f049

Browse files
committed
call it callback
1 parent 39abfff commit 1c1f049

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/nextjs/src/common/wrapRouteHandlerWithSentry.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ import { flushQueue } from './utils/responseEnd';
2121

2222
/** As our own HTTP integration is disabled (src/server/index.ts) the rootSpan comes from Next.js.
2323
* In case there is not root span, we start a new span. */
24-
function startOrUpdateSpan(
25-
spanName: string,
26-
handleResponseErrors: (rootSpan: Span) => Promise<Response>,
27-
): Promise<Response> {
24+
function startOrUpdateSpan(spanName: string, cb: (rootSpan: Span) => Promise<Response>): Promise<Response> {
2825
const activeSpan = getActiveSpan();
2926
const rootSpan = activeSpan && getRootSpan(activeSpan);
3027

@@ -34,7 +31,7 @@ function startOrUpdateSpan(
3431
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'http.server');
3532
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.function.nextjs');
3633

37-
return handleResponseErrors(rootSpan);
34+
return cb(rootSpan);
3835
} else {
3936
return startSpan(
4037
{
@@ -47,7 +44,7 @@ function startOrUpdateSpan(
4744
},
4845
},
4946
(span: Span) => {
50-
return handleResponseErrors(span);
47+
return cb(span);
5148
},
5249
);
5350
}

0 commit comments

Comments
 (0)