@base-web-kits/base-tools-web 1.3.15 → 1.3.18
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/README.md +1 -0
- package/dist/base-tools-web.umd.global.js +8 -0
- package/dist/base-tools-web.umd.global.js.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/web/network/request.ts +12 -0
package/dist/index.cjs
CHANGED
|
@@ -2268,6 +2268,14 @@ function handleStreamResponse(response, sseTask) {
|
|
|
2268
2268
|
}
|
|
2269
2269
|
function parseResponse(response, responseType) {
|
|
2270
2270
|
return __async(this, null, function* () {
|
|
2271
|
+
if (!response.ok) {
|
|
2272
|
+
const text = yield response.text();
|
|
2273
|
+
try {
|
|
2274
|
+
return JSON.parse(text);
|
|
2275
|
+
} catch (e) {
|
|
2276
|
+
throw new Error(`HTTP Error ${response.status}: ${text || response.statusText}`);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2271
2279
|
let resData;
|
|
2272
2280
|
if (responseType === "arraybuffer") {
|
|
2273
2281
|
resData = yield response.arrayBuffer();
|