@nxtedition/nxt-undici 4.2.25 → 4.2.26

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.
@@ -3,23 +3,19 @@ export default (opts) => (dispatch) => (opts, handler) => {
3
3
  return dispatch(opts, handler)
4
4
  }
5
5
 
6
- try {
7
- const body = opts.body({ signal: opts.signal })
6
+ const body = opts.body({ signal: opts.signal })
8
7
 
9
- if (typeof body?.then === 'function') {
10
- body
11
- .then((body) => {
12
- dispatch({ ...opts, body }, handler)
13
- })
14
- .catch((err) => {
15
- handler.onError(err)
16
- })
17
- return true
18
- } else {
19
- return dispatch({ ...opts, body }, handler)
20
- }
21
- } catch (err) {
22
- handler.onError(err)
8
+ if (typeof body?.then === 'function') {
9
+ body.then(
10
+ (body) => {
11
+ dispatch({ ...opts, body }, handler)
12
+ },
13
+ (err) => {
14
+ handler.onError(err)
15
+ },
16
+ )
23
17
  return true
18
+ } else {
19
+ return dispatch({ ...opts, body }, handler)
24
20
  }
25
21
  }
@@ -118,7 +118,7 @@ class Handler extends DecoratorHandler {
118
118
  err.code ??= this.#body.code
119
119
  }
120
120
  if (this.#body.error != null) {
121
- err.error ??= this.#body.errorq
121
+ err.error ??= this.#body.error
122
122
  }
123
123
  }
124
124
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "4.2.25",
3
+ "version": "4.2.26",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",