File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
dev-packages/node-integration-tests/suites/tracing-experimental/hapi Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,14 @@ const init = async () => {
4343 } ,
4444 } ) ;
4545
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+
4654 await Sentry . setupHapiErrorHandler ( server ) ;
4755 await server . start ( ) ;
4856
Original file line number Diff line number Diff line change @@ -58,4 +58,12 @@ describe('hapi auto-instrumentation', () => {
5858 . start ( done )
5959 . makeRequest ( 'get' , '/boom-error' ) ;
6060 } ) ;
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+ } ) ;
6169} ) ;
You can’t perform that action at this time.
0 commit comments