File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
test/e2e/opentelemetry/instrumentation
app/app/[param]/rsc-fetch/error Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff 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' ,
You can’t perform that action at this time.
0 commit comments