File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -281,7 +281,6 @@ class InterceptedClient extends BaseClient {
281281 /// Internal method that handles the actual request with retry logic
282282 Future <BaseResponse > _attemptRequestWithRetries (BaseRequest request,
283283 {bool isStream = false }) async {
284- BaseResponse response;
285284 try {
286285 // Intercept request
287286 final interceptedRequest = await _interceptRequest (request);
@@ -358,7 +357,7 @@ class InterceptedClient extends BaseClient {
358357 stream = await completer.future;
359358 }
360359
361- response = isStream ? stream : await Response .fromStream (stream);
360+ final response = isStream ? stream : await Response .fromStream (stream);
362361
363362 if (retryPolicy != null &&
364363 retryPolicy! .maxRetryAttempts > _retryCount &&
@@ -368,6 +367,8 @@ class InterceptedClient extends BaseClient {
368367 .delayRetryAttemptOnResponse (retryAttempt: _retryCount));
369368 return _attemptRequestWithRetries (request, isStream: isStream);
370369 }
370+
371+ return response;
371372 } on Exception catch (error) {
372373 if (retryPolicy != null &&
373374 retryPolicy! .maxRetryAttempts > _retryCount &&
@@ -380,8 +381,6 @@ class InterceptedClient extends BaseClient {
380381 rethrow ;
381382 }
382383 }
383-
384- return response;
385384 }
386385
387386 /// This internal function intercepts the request.
You can’t perform that action at this time.
0 commit comments