File tree 2 files changed +16
-0
lines changed
dev-packages/node-integration-tests/suites/tracing-experimental/hapi
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,14 @@ const init = async () => {
43
43
} ,
44
44
} ) ;
45
45
46
+ server . route ( {
47
+ method : 'GET' ,
48
+ path : '/promise-error' ,
49
+ handler : async ( _request , _h ) => {
50
+ return Promise . reject ( new Error ( 'Sentry Test Error' ) ) ;
51
+ } ,
52
+ } ) ;
53
+
46
54
await Sentry . setupHapiErrorHandler ( server ) ;
47
55
await server . start ( ) ;
48
56
Original file line number Diff line number Diff line change @@ -58,4 +58,12 @@ describe('hapi auto-instrumentation', () => {
58
58
. start ( done )
59
59
. makeRequest ( 'get' , '/boom-error' ) ;
60
60
} ) ;
61
+
62
+ test ( 'CJS - should handle promise rejections in routes.' , done => {
63
+ createRunner ( __dirname , 'scenario.js' )
64
+ . expect ( { event : EXPECTED_ERROR_EVENT } )
65
+ . expectError ( )
66
+ . start ( done )
67
+ . makeRequest ( 'get' , '/promise-error' ) ;
68
+ } ) ;
61
69
} ) ;
You can’t perform that action at this time.
0 commit comments