Skip to content

Commit

Permalink
perf: error response text
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Sep 18, 2023
1 parent ea35d07 commit df07084
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/service/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const jsonRes = <T = any>(
}

// another error
let msg = message || error?.message;
let msg = error?.response?.statusText || error?.message || '请求错误';
if ((code < 200 || code >= 400) && !message) {
msg = error?.message || '请求错误';
if (typeof error === 'string') {
Expand Down Expand Up @@ -81,7 +81,7 @@ export const sseErrRes = (res: NextApiResponse, error: any) => {
});
}

let msg = error?.message || '请求错误';
let msg = error?.response?.statusText || error?.message || '请求错误';
if (typeof error === 'string') {
msg = error;
} else if (proxyError[error?.code]) {
Expand Down

0 comments on commit df07084

Please sign in to comment.