@@ -42,7 +42,6 @@ export type AsyncHandler<T extends Handler> = (
42
42
43
43
export interface WrapperOptions {
44
44
flushTimeout : number ;
45
- rethrowAfterCapture : boolean ;
46
45
callbackWaitsForEmptyEventLoop : boolean ;
47
46
captureTimeoutWarning : boolean ;
48
47
timeoutWarningLimit : number ;
@@ -215,11 +214,10 @@ function enhanceScopeWithEnvironmentData(scope: Scope, context: Context, startTi
215
214
export function wrapHandler < TEvent , TResult > (
216
215
handler : Handler < TEvent , TResult > ,
217
216
wrapOptions : Partial < WrapperOptions > = { } ,
218
- ) : Handler < TEvent , TResult | undefined > {
217
+ ) : Handler < TEvent , TResult > {
219
218
const START_TIME = performance . now ( ) ;
220
219
const options : WrapperOptions = {
221
220
flushTimeout : 2000 ,
222
- rethrowAfterCapture : true ,
223
221
callbackWaitsForEmptyEventLoop : false ,
224
222
captureTimeoutWarning : true ,
225
223
timeoutWarningLimit : 500 ,
@@ -293,7 +291,7 @@ export function wrapHandler<TEvent, TResult>(
293
291
294
292
const hub = getCurrentHub ( ) ;
295
293
const scope = hub . pushScope ( ) ;
296
- let rv : TResult | undefined ;
294
+ let rv : TResult ;
297
295
try {
298
296
enhanceScopeWithEnvironmentData ( scope , context , START_TIME ) ;
299
297
// We put the transaction on the scope so users can attach children to it
@@ -309,9 +307,7 @@ export function wrapHandler<TEvent, TResult>(
309
307
}
310
308
} catch ( e ) {
311
309
captureException ( e ) ;
312
- if ( options . rethrowAfterCapture ) {
313
- throw e ;
314
- }
310
+ throw e ;
315
311
} finally {
316
312
clearTimeout ( timeoutWarningTimer ) ;
317
313
transaction . finish ( ) ;
0 commit comments