Skip to content

Commit 587782a

Browse files
committed
call it callback
1 parent 4fb1730 commit 587782a

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
@@ -22,10 +22,7 @@ import { withIsolationScopeOrReuseFromRootSpan } from './utils/withIsolationScop
2222

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

@@ -35,7 +32,7 @@ function startOrUpdateSpan(
3532
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'http.server');
3633
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.function.nextjs');
3734

38-
return handleResponseErrors(rootSpan);
35+
return cb(rootSpan);
3936
} else {
4037
return startSpan(
4138
{
@@ -48,7 +45,7 @@ function startOrUpdateSpan(
4845
},
4946
},
5047
(span: Span) => {
51-
return handleResponseErrors(span);
48+
return cb(span);
5249
},
5350
);
5451
}

0 commit comments

Comments
 (0)