@@ -42,7 +42,6 @@ export type AsyncHandler<T extends Handler> = (
4242
4343export interface WrapperOptions {
4444 flushTimeout : number ;
45- rethrowAfterCapture : boolean ;
4645 callbackWaitsForEmptyEventLoop : boolean ;
4746 captureTimeoutWarning : boolean ;
4847 timeoutWarningLimit : number ;
@@ -215,11 +214,10 @@ function enhanceScopeWithEnvironmentData(scope: Scope, context: Context, startTi
215214export function wrapHandler < TEvent , TResult > (
216215 handler : Handler < TEvent , TResult > ,
217216 wrapOptions : Partial < WrapperOptions > = { } ,
218- ) : Handler < TEvent , TResult | undefined > {
217+ ) : Handler < TEvent , TResult > {
219218 const START_TIME = performance . now ( ) ;
220219 const options : WrapperOptions = {
221220 flushTimeout : 2000 ,
222- rethrowAfterCapture : true ,
223221 callbackWaitsForEmptyEventLoop : false ,
224222 captureTimeoutWarning : true ,
225223 timeoutWarningLimit : 500 ,
@@ -293,7 +291,7 @@ export function wrapHandler<TEvent, TResult>(
293291
294292 const hub = getCurrentHub ( ) ;
295293 const scope = hub . pushScope ( ) ;
296- let rv : TResult | undefined ;
294+ let rv : TResult ;
297295 try {
298296 enhanceScopeWithEnvironmentData ( scope , context , START_TIME ) ;
299297 // We put the transaction on the scope so users can attach children to it
@@ -309,9 +307,7 @@ export function wrapHandler<TEvent, TResult>(
309307 }
310308 } catch ( e ) {
311309 captureException ( e ) ;
312- if ( options . rethrowAfterCapture ) {
313- throw e ;
314- }
310+ throw e ;
315311 } finally {
316312 clearTimeout ( timeoutWarningTimer ) ;
317313 transaction . finish ( ) ;
0 commit comments