@marianmeres/http-utils 1.15.0 → 1.18.0
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.
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -296,6 +296,7 @@ const getErrorMessage = (e, stripErrorPrefix = true) => {
|
|
|
296
296
|
// non-standard "body" is this package's HttpError prop
|
|
297
297
|
body?.error?.message ||
|
|
298
298
|
body?.message ||
|
|
299
|
+
body?.error ||
|
|
299
300
|
(typeof body === 'string' ? body : null) ||
|
|
300
301
|
// the common message from Error ctor (e.g. "Foo" if new TypeError("Foo"))
|
|
301
302
|
e?.message ||
|
|
@@ -369,6 +370,7 @@ const _fetch = async (params, respHeaders = null, errorMessageExtractor = null,
|
|
|
369
370
|
// try opinionated convention first
|
|
370
371
|
_body?.error?.message ||
|
|
371
372
|
_body?.message ||
|
|
373
|
+
_body?.error ||
|
|
372
374
|
_response?.statusText ||
|
|
373
375
|
'Unknown error';
|
|
374
376
|
if (msg.length > 255)
|
package/dist/index.js
CHANGED
|
@@ -294,6 +294,7 @@ const getErrorMessage = (e, stripErrorPrefix = true) => {
|
|
|
294
294
|
// non-standard "body" is this package's HttpError prop
|
|
295
295
|
body?.error?.message ||
|
|
296
296
|
body?.message ||
|
|
297
|
+
body?.error ||
|
|
297
298
|
(typeof body === 'string' ? body : null) ||
|
|
298
299
|
// the common message from Error ctor (e.g. "Foo" if new TypeError("Foo"))
|
|
299
300
|
e?.message ||
|
|
@@ -367,6 +368,7 @@ const _fetch = async (params, respHeaders = null, errorMessageExtractor = null,
|
|
|
367
368
|
// try opinionated convention first
|
|
368
369
|
_body?.error?.message ||
|
|
369
370
|
_body?.message ||
|
|
371
|
+
_body?.error ||
|
|
370
372
|
_response?.statusText ||
|
|
371
373
|
'Unknown error';
|
|
372
374
|
if (msg.length > 255)
|