@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/dist/index.mjs CHANGED
@@ -2205,6 +2205,14 @@ function handleStreamResponse(response, sseTask) {
2205
2205
  }
2206
2206
  function parseResponse(response, responseType) {
2207
2207
  return __async(this, null, function* () {
2208
+ if (!response.ok) {
2209
+ const text = yield response.text();
2210
+ try {
2211
+ return JSON.parse(text);
2212
+ } catch (e) {
2213
+ throw new Error(`HTTP Error ${response.status}: ${text || response.statusText}`);
2214
+ }
2215
+ }
2208
2216
  let resData;
2209
2217
  if (responseType === "arraybuffer") {
2210
2218
  resData = yield response.arrayBuffer();