braid-http 1.0.3 → 1.0.4
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/braid-http-client.js +5 -1
- package/package.json +1 -1
package/braid-http-client.js
CHANGED
|
@@ -350,7 +350,11 @@ async function braid_fetch (url, params = {}) {
|
|
|
350
350
|
case 504: // Gateway Timeout
|
|
351
351
|
give_up = false;
|
|
352
352
|
}
|
|
353
|
-
if (give_up)
|
|
353
|
+
if (give_up) {
|
|
354
|
+
let e = new Error(`giving up because of http status: ${res.status}${(res.status === 401 || res.status === 403) ? ` (access denied)` : ''}`)
|
|
355
|
+
subscription_error?.(e)
|
|
356
|
+
return fail(e)
|
|
357
|
+
}
|
|
354
358
|
if (!res.ok) throw new Error(`status not ok: ${res.status}`)
|
|
355
359
|
}
|
|
356
360
|
|