@@ -210,9 +210,7 @@ export function ConcurrencyQueue ({ axios, config, plugins = [] }) {
210210 safeAxiosRequest ( requestConfig )
211211 . then ( ( response ) => {
212212 // On successful retry, call the original onComplete to properly clean up
213- if ( error . config && error . config . onComplete ) {
214- error . config . onComplete ( )
215- }
213+ error ?. config ?. onComplete ?. ( )
216214 shift ( ) // Process next queued request
217215 resolve ( response )
218216 } )
@@ -224,17 +222,13 @@ export function ConcurrencyQueue ({ axios, config, plugins = [] }) {
224222 . then ( resolve )
225223 . catch ( ( finalError ) => {
226224 // On final failure, clean up the running queue
227- if ( error . config && error . config . onComplete ) {
228- error . config . onComplete ( )
229- }
225+ error ?. config ?. onComplete ?. ( )
230226 shift ( ) // Process next queued request
231227 reject ( finalError )
232228 } )
233229 } else {
234230 // On non-retryable error, clean up the running queue
235- if ( error . config && error . config . onComplete ) {
236- error . config . onComplete ( )
237- }
231+ error ?. config ?. onComplete ?. ( )
238232 shift ( ) // Process next queued request
239233 reject ( retryError )
240234 }
@@ -483,7 +477,7 @@ export function ConcurrencyQueue ({ axios, config, plugins = [] }) {
483477 ? error . message
484478 : 'Network request failed: error object missing request config'
485479 )
486- if ( error && error . code ) fallbackError . code = error . code
480+ fallbackError . code = error ? .code
487481 fallbackError . originalError = error
488482 return Promise . reject ( runPluginOnResponseForError ( fallbackError ) )
489483 }
0 commit comments