Skip to content

Commit ad5418d

Browse files
authored
fix(nextjs): Flush with waitUntil in captureRequestError (#15146)
1 parent 9622bba commit ad5418d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/nextjs/src/common/captureRequestError.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { RequestEventData } from '@sentry/core';
2+
import { vercelWaitUntil } from '@sentry/core';
23
import { captureException, headersToDict, withScope } from '@sentry/core';
4+
import { flushSafelyWithTimeout } from './utils/responseEnd';
35

46
type RequestInfo = {
57
path: string;
@@ -39,5 +41,7 @@ export function captureRequestError(error: unknown, request: RequestInfo, errorC
3941
handled: false,
4042
},
4143
});
44+
45+
vercelWaitUntil(flushSafelyWithTimeout());
4246
});
4347
}

0 commit comments

Comments
 (0)