@whitesev/utils 1.4.9 → 1.5.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.esm.js CHANGED
@@ -1778,6 +1778,13 @@ class Httpx {
1778
1778
  else if ("onabort" in this.context.#defaultDetails) {
1779
1779
  this.context.#defaultDetails.onabort.apply(this, argumentsList);
1780
1780
  }
1781
+ if (this.context.HttpxResponseHook.errorResponseCallBack({
1782
+ type: "onabort",
1783
+ error: new TypeError("request canceled"),
1784
+ response: null,
1785
+ }) == null) {
1786
+ return;
1787
+ }
1781
1788
  resolve({
1782
1789
  status: false,
1783
1790
  data: [...argumentsList],
@@ -2203,7 +2210,7 @@ class Httpx {
2203
2210
  */
2204
2211
  use(successFn, errorFn) {
2205
2212
  if (typeof successFn !== "function" && typeof errorFn !== "function") {
2206
- console.warn("[Httpx-interceptors-response] 请传入拦截器函数");
2213
+ console.warn("[Httpx-interceptors-response] 必须传入一个拦截器函数");
2207
2214
  return;
2208
2215
  }
2209
2216
  return this.context.HttpxResponseHook.add(successFn, errorFn);