@base-web-kits/base-tools-web 1.3.5 → 1.3.8

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 CHANGED
@@ -1486,7 +1486,8 @@ function request(config) {
1486
1486
  reject(timeoutError);
1487
1487
  return;
1488
1488
  }
1489
- if (!isAbortError && toastError) (_h = appConfig2.toast) == null ? void 0 : _h.call(appConfig2, { status, msg: "\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25" });
1489
+ if (!isAbortError && toastError)
1490
+ (_h = appConfig2.toast) == null ? void 0 : _h.call(appConfig2, { status, msg: `\u8BF7\u6C42\u5931\u8D25,${String(e)}` });
1490
1491
  logRequestInfo({ status, config: logConfig, startTime, e });
1491
1492
  reject(e);
1492
1493
  } finally {
@@ -1536,7 +1537,7 @@ function logRequestInfo(options) {
1536
1537
  info.res = cloneDeep(res);
1537
1538
  log("info", info);
1538
1539
  } else {
1539
- info.e = e;
1540
+ info.e = e instanceof Error ? { name: e.name, message: e.message, stack: e.stack } : String(e);
1540
1541
  log("error", info);
1541
1542
  }
1542
1543
  }
@@ -1555,9 +1556,11 @@ function checkCache(cacheKey) {
1555
1556
  }
1556
1557
  function handleStreamResponse(response, sseTask) {
1557
1558
  return __async(this, null, function* () {
1558
- if (!response.body) return "Stream is empty";
1559
+ if (!response.body) throw new Error("Response body is null");
1559
1560
  if (sseTask.parser === void 0) {
1560
- return "onMessage is undefined \u2192 Stream parser skipped";
1561
+ throw new Error(
1562
+ "Stream parser missing: Please set config.onMessage when enableChunked is true"
1563
+ );
1561
1564
  }
1562
1565
  const reader = response.body.getReader();
1563
1566
  while (true) {