保留模型选择保存错误正文

模型配置写回失败时展示具体 IPC 或配置错误
This commit is contained in:
kdletters
2026-10-05 16:47:41 +08:00
parent 0956ab0213
commit d303428a6f
@@ -198,8 +198,10 @@ export function ConversationModelSelect({
),
}),
);
} catch {
throw new ModelSelectionConfigError('模型选择保存失败');
} catch (error) {
throw new ModelSelectionConfigError(
visibleClientErrorMessage(error, '模型选择保存失败'),
);
}
if (
persisted.config.selectedModelId !== next ||
@@ -382,8 +384,10 @@ export function ConversationModelSelect({
setNotice('');
}
markReady(true);
} catch {
if (mountedRef.current) setError('模型选择保存失败');
} catch (error) {
if (mountedRef.current) {
setError(visibleClientErrorMessage(error, '模型选择保存失败'));
}
markReady(false);
} finally {
if (mountedRef.current) setBusy(false);