diff --git a/apps/web-antd/src/api/request.ts b/apps/web-antd/src/api/request.ts index e95f24662c0..70a0788991c 100644 --- a/apps/web-antd/src/api/request.ts +++ b/apps/web-antd/src/api/request.ts @@ -78,7 +78,7 @@ function createRequestClient(baseURL: string) { if (status >= 200 && status < 400 && code === 0) { return data; } - throw new Error(`Error ${status}: ${msg}`); + throw { response }; }, }); diff --git a/playground/src/api/request.ts b/playground/src/api/request.ts index 72617d1fc63..c5080284dd1 100644 --- a/playground/src/api/request.ts +++ b/playground/src/api/request.ts @@ -79,7 +79,7 @@ function createRequestClient(baseURL: string) { if (status >= 200 && status < 400 && code === 0) { return data; } - throw new Error(`Error ${status}: ${msg}`); + throw { response }; }, });