File tree Expand file tree Collapse file tree 5 files changed +81
-0
lines changed
dev-packages/e2e-tests/test-applications/solidstart Expand file tree Collapse file tree 5 files changed +81
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ export default function Home() {
2525 < li >
2626 < A href = "/back-navigation" > Test back navigation</ A >
2727 </ li >
28+ < li >
29+ < A href = "/uncaught-route-error" > Test uncaught errors in routes</ A >
30+ </ li >
31+ < li >
32+ < A href = "/server-error-without-instrumentation" > Test uncaught errors in server action without instrumentation wrapper</ A >
33+ </ li >
2834 </ ul >
2935 </ >
3036 ) ;
Original file line number Diff line number Diff line change 1+ export default function UncaughtErrorPage ( ) {
2+ throw new Error ( 'Uncaught error thrown in UncaughtErrorPage route from Solid Start E2E test app' ) ;
3+ }
Original file line number Diff line number Diff line change 1+ import { createAsync } from '@solidjs/router' ;
2+ const getPrefecture = async ( ) => {
3+ 'use server' ;
4+ throw new Error ( 'Error thrown from Solid Start E2E test app server route without instrumentation wrapper' ) ;
5+
6+ return { prefecture : 'Kanagawa' } ;
7+ } ;
8+
9+ export default function UncaughtServerErrorWithoutInstrumentationPage ( ) {
10+ const data = createAsync ( ( ) => getPrefecture ( ) ) ;
11+
12+ return < div > Prefecture: { data ( ) ?. prefecture } </ div > ;
13+ }
Original file line number Diff line number Diff line change 1+ import { expect , test } from '@playwright/test' ;
2+ import { waitForError } from '@sentry-internal/test-utils' ;
3+
4+ test . describe ( 'server-side errors' , ( ) => {
5+ test ( 'captures server action error' , async ( { page } ) => {
6+ const errorEventPromise = waitForError ( 'solidstart' , errorEvent => {
7+ return errorEvent ?. exception ?. values ?. [ 0 ] ?. value === 'Error thrown from Solid Start E2E test app server route without instrumentation wrapper' ;
8+ } ) ;
9+
10+ await page . goto ( `/uncaught-server-error-without-instrumentation` ) ;
11+
12+ const error = await errorEventPromise ;
13+
14+ expect ( error ) . toMatchObject ( {
15+ exception : {
16+ values : [
17+ {
18+ type : 'Error' ,
19+ value : 'Error thrown from Solid Start E2E test app server route without instrumentation wrapper' ,
20+ mechanism : {
21+ type : 'solidstart' ,
22+ handled : false ,
23+ } ,
24+ } ,
25+ ] ,
26+ } ,
27+ transaction : 'GET /uncaught-server-error-without-instrumentation' ,
28+ } ) ;
29+ } ) ;
30+ } ) ;
Original file line number Diff line number Diff line change 1+ import { expect , test } from '@playwright/test' ;
2+ import { waitForError } from '@sentry-internal/test-utils' ;
3+
4+ test . describe ( 'client-side errors' , ( ) => {
5+ test ( 'captures error thrown on click' , async ( { page } ) => {
6+ const errorPromise = waitForError ( 'solidstart' , async errorEvent => {
7+ return errorEvent ?. exception ?. values ?. [ 0 ] ?. value === 'Uncaught error thrown in UncaughtErrorPage route from Solid Start E2E test app' ;
8+ } ) ;
9+
10+ await page . goto ( `/uncaught-route-error` ) ;
11+ const error = await errorPromise ;
12+
13+ expect ( error ) . toMatchObject ( {
14+ exception : {
15+ values : [
16+ {
17+ type : 'Error' ,
18+ value : 'Uncaught error thrown in UncaughtErrorPage route from Solid Start E2E test app' ,
19+ mechanism : {
20+ handled : false ,
21+ } ,
22+ } ,
23+ ] ,
24+ } ,
25+ transaction : '/uncaught-route-error' ,
26+ } ) ;
27+ expect ( error . transaction ) . toEqual ( '/uncaught-route-error' ) ;
28+ } ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments