mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-10 18:02:55 +00:00
feat: 优化错误处理逻辑,简化错误消息输出
This commit is contained in:
parent
31c157f58f
commit
bea5058df8
@ -228,7 +228,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
$A.modalError({
|
||||
content: error?.msg || error || '获取模型列表失败',
|
||||
content: error?.msg || '获取模型列表失败',
|
||||
onOk: _ => {
|
||||
this.showModal = false;
|
||||
},
|
||||
@ -367,7 +367,7 @@ export default {
|
||||
this.inputValue = '';
|
||||
this.startStream(streamKey, responseEntry);
|
||||
} catch (error) {
|
||||
const msg = error?.msg || error || '发送失败';
|
||||
const msg = error?.msg || '发送失败';
|
||||
if (responseEntry) {
|
||||
this.markResponseError(responseEntry, msg);
|
||||
}
|
||||
@ -697,7 +697,7 @@ export default {
|
||||
result.then(() => {
|
||||
this.closeAssistant();
|
||||
}).catch(error => {
|
||||
$A.modalError(error?.msg || error || '应用失败');
|
||||
$A.modalError(error?.msg || '应用失败');
|
||||
}).finally(() => {
|
||||
response.applyLoading = false;
|
||||
});
|
||||
@ -707,7 +707,7 @@ export default {
|
||||
}
|
||||
} catch (error) {
|
||||
response.applyLoading = false;
|
||||
$A.modalError(error?.msg || error || '应用错误');
|
||||
$A.modalError(error?.msg || '应用错误');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -646,8 +646,7 @@ export default {
|
||||
});
|
||||
this.appSorts = this.normalizeSortPayload(data?.sorts);
|
||||
} catch (error) {
|
||||
const msg = error?.msg || error?.message;
|
||||
msg && console.warn(msg);
|
||||
console.warn(error?.msg || error);
|
||||
} finally {
|
||||
this.appSortLoading = false;
|
||||
this.appSortLoaded = true;
|
||||
|
||||
@ -266,7 +266,7 @@ export default {
|
||||
} catch (error) {
|
||||
$A.modalError({
|
||||
language: false,
|
||||
content: this.$L("AI开启新会话失败") + `: ${error.msg || error}`,
|
||||
content: this.$L("AI开启新会话失败") + `: ${error.msg || 'Unknown Error'}`,
|
||||
});
|
||||
reject(error);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user