improve error messages

This commit is contained in:
josc146 2023-06-16 00:35:39 +08:00
parent b1d5b84dd6
commit b06e292989
2 changed files with 4 additions and 8 deletions

View File

@ -137,7 +137,6 @@
"Custom Models Path": "自定义模型路径",
"Microsoft Visual C++ Redistributable is not installed, would you like to download it?": "微软VC++组件未安装, 是否下载?",
"File Path Cannot Contain Space": "文件路径不能包含空格",
"Failed to switch model, please try starting the program with administrator privileges or increasing your virtual memory.": "切换模型失败, 请尝试以管理员权限启动程序, 或增加你的虚拟内存",
"Current Strategy": "当前Strategy",
"MacOS is not yet supported for performing this operation, please do it manually.": "MacOS尚未支持此操作, 请手动执行",
"Linux is not yet supported for performing this operation, please do it manually.": "Linux尚未支持此操作, 请手动执行",

View File

@ -196,7 +196,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
model: modelPath,
strategy: getStrategy(modelConfig),
customCuda: customCudaFile !== ''
}).then((r) => {
}).then(async (r) => {
if (r.ok) {
commonStore.setStatus({ status: ModelStatus.Working });
toastWithButton(t('Startup Completed'), t('Chat'), () => {
@ -206,14 +206,11 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
toast(t('Loading Model'), { type: 'info' });
} else {
commonStore.setStatus({ status: ModelStatus.Offline });
toast(t('Failed to switch model'), { type: 'error' });
toast(t('Failed to switch model') + ' - ' + await r.text(), { type: 'error' });
}
}).catch(() => {
}).catch((e) => {
commonStore.setStatus({ status: ModelStatus.Offline });
if (commonStore.platform === 'windows')
toast(t('Failed to switch model, please try starting the program with administrator privileges or increasing your virtual memory.'), { type: 'error' });
else
toast(t('Failed to switch model'), { type: 'error' });
toast(t('Failed to switch model') + ' - ' + e.message || e, { type: 'error' });
});
}
}).catch(() => {