@nxtedition/nxt-undici 6.2.16 → 6.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -252,29 +252,26 @@ class Handler extends DecoratorHandler {
|
|
|
252
252
|
let retryPromise
|
|
253
253
|
try {
|
|
254
254
|
if (typeof this.#opts.retry === 'function') {
|
|
255
|
-
retryPromise =
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
255
|
+
retryPromise = Promise.resolve(
|
|
256
|
+
this.#opts.retry(
|
|
257
|
+
decorateError(err, this.#opts, {
|
|
258
|
+
statusCode: this.#statusCode,
|
|
259
|
+
headers: this.#headers,
|
|
260
|
+
trailers: this.#trailers,
|
|
261
|
+
body: this.#body,
|
|
262
|
+
}),
|
|
263
|
+
this.#retryCount,
|
|
264
|
+
this.#opts,
|
|
265
|
+
() => this.#retryFn(err, this.#retryCount, this.#opts),
|
|
266
|
+
),
|
|
265
267
|
)
|
|
266
268
|
} else {
|
|
267
|
-
retryPromise = this.#retryFn(err, this.#retryCount, this.#opts)
|
|
269
|
+
retryPromise = Promise.resolve(this.#retryFn(err, this.#retryCount, this.#opts))
|
|
268
270
|
}
|
|
269
271
|
} catch (err) {
|
|
270
272
|
retryPromise = Promise.reject(err)
|
|
271
273
|
}
|
|
272
274
|
|
|
273
|
-
if (retryPromise == null) {
|
|
274
|
-
this.#maybeError(err)
|
|
275
|
-
return
|
|
276
|
-
}
|
|
277
|
-
|
|
278
275
|
retryPromise
|
|
279
276
|
.then((shouldRetry) => {
|
|
280
277
|
if (this.#aborted) {
|