perf: error response

This commit is contained in:
archer
2023-04-24 18:08:49 +08:00
parent e60c36b423
commit dd2d93c953
3 changed files with 3 additions and 27 deletions

View File

@@ -32,6 +32,8 @@ export const jsonRes = <T = any>(
msg = error;
} else if (proxyError[error?.code]) {
msg = '服务器代理出错';
} else if (error?.response?.data?.error?.message) {
msg = error?.response?.data?.error?.message;
} else if (openaiError2[error?.response?.data?.error?.type]) {
msg = openaiError2[error?.response?.data?.error?.type];
} else if (openaiError[error?.response?.statusText]) {