报错优化
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user