@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 = this.#opts.retry(
256
- decorateError(err, this.#opts, {
257
- statusCode: this.#statusCode,
258
- headers: this.#headers,
259
- trailers: this.#trailers,
260
- body: this.#body,
261
- }),
262
- this.#retryCount,
263
- this.#opts,
264
- () => this.#retryFn(err, this.#retryCount, this.#opts),
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "6.2.16",
3
+ "version": "6.2.17",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",