报错优化

This commit is contained in:
2025-09-21 20:48:40 +08:00
parent 274f02b867
commit 17f2d64207
4 changed files with 297 additions and 151 deletions
@@ -49,7 +49,7 @@ export class EmotionAIService {
error as Error,
ErrorType.API_ERROR,
{ config: { ...emotionConfig, apiKey: "***" } }, // 隐藏API密钥
true
false
);
throw error;
}
@@ -217,7 +217,7 @@ export class EmotionAIService {
new Error(warningMsg),
ErrorType.API_ERROR,
{ roleId, message, response },
true
false
);
return null;
}
+2 -2
View File
@@ -102,10 +102,10 @@ export class ErrorHandler {
requestData,
responseError: error,
};
if (error.status == "FAILED_PRECONDITION") {
if (details.responseError.message.includes("FAILED_PRECONDITION")) {
//当前用户区域不支持聊天功能
TipsPanel.show(LanguageUtils.getText("chat_error_code_2003"));
} else if (error.message.includes("Fetch is aborted")) {
} else if (error.message.includes("aborted")) {
TipsPanel.show(LanguageUtils.getText("chat_error_code_2004"));
} else {
this.handleError(