rxtutils 1.1.8 → 1.1.9
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/cjs/request/index.cjs +3 -5
- package/es/request/index.mjs +3 -5
- package/package.json +1 -1
package/cjs/request/index.cjs
CHANGED
|
@@ -109,7 +109,7 @@ function createBaseRequest(baseOptions) {
|
|
|
109
109
|
return finalData;
|
|
110
110
|
}
|
|
111
111
|
const { [errorCode]: customHandler = defaultErrorCodeHandler } = errorCodeMap;
|
|
112
|
-
const err = new error.default("服务端错误", "server", res);
|
|
112
|
+
const err = new error.default("服务端错误", "server", res, errorCode);
|
|
113
113
|
if (typeof customHandler === "string") {
|
|
114
114
|
defaultMessageShower(customHandler);
|
|
115
115
|
const retryTask = retry();
|
|
@@ -140,7 +140,7 @@ function createBaseRequest(baseOptions) {
|
|
|
140
140
|
if (error$1.response) {
|
|
141
141
|
let resData = error$1;
|
|
142
142
|
const { [error$1.response.status]: customHandler = defaultHttpErrorCodeHandler } = httpErrorCodeMap;
|
|
143
|
-
const err = new error.default("服务端错误", "http", error$1);
|
|
143
|
+
const err = new error.default("服务端错误", "http", error$1, error$1.response.status);
|
|
144
144
|
if (typeof customHandler === "string") {
|
|
145
145
|
defaultMessageShower(customHandler);
|
|
146
146
|
const retryTask = retry();
|
|
@@ -168,9 +168,7 @@ function createBaseRequest(baseOptions) {
|
|
|
168
168
|
return resData;
|
|
169
169
|
} else {
|
|
170
170
|
let resData = error$1;
|
|
171
|
-
const err = new error.default("服务端错误", "http", error$1);
|
|
172
|
-
err.type = "http";
|
|
173
|
-
err.data = error$1;
|
|
171
|
+
const err = new error.default("服务端错误", "http", error$1, void 0);
|
|
174
172
|
const { replaceResData = error$1, throwError: handlerThrowError = "default" } = Object(await otherErrorHandler(error$1));
|
|
175
173
|
const retryTask = retry();
|
|
176
174
|
if (retryTask) return retryTask;
|
package/es/request/index.mjs
CHANGED
|
@@ -107,7 +107,7 @@ function createBaseRequest(baseOptions) {
|
|
|
107
107
|
return finalData;
|
|
108
108
|
}
|
|
109
109
|
const { [errorCode]: customHandler = defaultErrorCodeHandler } = errorCodeMap;
|
|
110
|
-
const err = new RequestError("服务端错误", "server", res);
|
|
110
|
+
const err = new RequestError("服务端错误", "server", res, errorCode);
|
|
111
111
|
if (typeof customHandler === "string") {
|
|
112
112
|
defaultMessageShower(customHandler);
|
|
113
113
|
const retryTask = retry();
|
|
@@ -138,7 +138,7 @@ function createBaseRequest(baseOptions) {
|
|
|
138
138
|
if (error.response) {
|
|
139
139
|
let resData = error;
|
|
140
140
|
const { [error.response.status]: customHandler = defaultHttpErrorCodeHandler } = httpErrorCodeMap;
|
|
141
|
-
const err = new RequestError("服务端错误", "http", error);
|
|
141
|
+
const err = new RequestError("服务端错误", "http", error, error.response.status);
|
|
142
142
|
if (typeof customHandler === "string") {
|
|
143
143
|
defaultMessageShower(customHandler);
|
|
144
144
|
const retryTask = retry();
|
|
@@ -166,9 +166,7 @@ function createBaseRequest(baseOptions) {
|
|
|
166
166
|
return resData;
|
|
167
167
|
} else {
|
|
168
168
|
let resData = error;
|
|
169
|
-
const err = new RequestError("服务端错误", "http", error);
|
|
170
|
-
err.type = "http";
|
|
171
|
-
err.data = error;
|
|
169
|
+
const err = new RequestError("服务端错误", "http", error, void 0);
|
|
172
170
|
const { replaceResData = error, throwError: handlerThrowError = "default" } = Object(await otherErrorHandler(error));
|
|
173
171
|
const retryTask = retry();
|
|
174
172
|
if (retryTask) return retryTask;
|