Skip to content

Commit 53ff487

Browse files
committed
test: page shouldnt error directly for PPR
1 parent aba8435 commit 53ff487

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
export default function Page() {
2-
throw new Error('Error from Server Component')
1+
export default async function Page({
2+
searchParams,
3+
}: {
4+
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
5+
}) {
6+
const { status } = await searchParams
7+
8+
if (status === 'error') {
9+
throw new Error('Error from Server Component')
10+
}
11+
12+
return <p>Page</p>
313
}

test/e2e/opentelemetry/instrumentation/opentelemetry.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,10 @@ describe('opentelemetry', () => {
531531
})
532532

533533
it('should handle error in RSC', async () => {
534-
await next.fetch('/app/param/rsc-fetch/error', env.fetchInit)
534+
await next.fetch(
535+
'/app/param/rsc-fetch/error?status=error',
536+
env.fetchInit
537+
)
535538

536539
await expectTrace(getCollector(), [
537540
{
@@ -540,7 +543,7 @@ describe('opentelemetry', () => {
540543
'http.method': 'GET',
541544
'http.route': '/app/[param]/rsc-fetch/error',
542545
'http.status_code': 500,
543-
'http.target': '/app/param/rsc-fetch/error',
546+
'http.target': '/app/param/rsc-fetch/error?status=error',
544547
'next.route': '/app/[param]/rsc-fetch/error',
545548
'next.rsc': false,
546549
'next.span_name': 'GET /app/[param]/rsc-fetch/error',

0 commit comments

Comments
 (0)