File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -1108,22 +1108,19 @@ async function sendRequest(
11081108 await options . onBeforeRequest ( req )
11091109 }
11101110
1111- const sendWithStallDetection = async ( ) : Promise < HttpResponse > => {
1112- if ( stallDetector ) {
1113- stallDetector . start ( )
1114- }
1111+ if ( stallDetector ) {
1112+ stallDetector . start ( )
1113+ }
11151114
1116- try {
1117- return await req . send ( body )
1118- } finally {
1119- if ( stallDetector ) {
1120- stallDetector . stop ( )
1121- }
1115+ let res : HttpResponse
1116+ try {
1117+ res = await req . send ( body )
1118+ } finally {
1119+ if ( stallDetector ) {
1120+ stallDetector . stop ( )
11221121 }
11231122 }
11241123
1125- const res = await sendWithStallDetection ( )
1126-
11271124 if ( typeof options . onAfterResponse === 'function' ) {
11281125 await options . onAfterResponse ( req , res )
11291126 }
You can’t perform that action at this time.
0 commit comments