收敛剩余客户端错误提示
统一更新、模型目录、错误上报和语音入口的敏感信息脱敏 保留真实错误正文并补齐共享错误处理出口
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
getPendingClientErrorEvents,
|
||||
readApplicationDiagnosticLogs,
|
||||
submitErrorReportBatch,
|
||||
visibleClientErrorMessage,
|
||||
} from '../../services/errorReporting';
|
||||
import { ThemedModal } from '../modal/ThemedModal';
|
||||
|
||||
@@ -116,9 +117,7 @@ export function ErrorReportDialog({
|
||||
window.setTimeout(onClose, 700);
|
||||
void ackClientErrorEventsWithRetry(selectedEvents);
|
||||
} catch (error) {
|
||||
setStatus(
|
||||
error instanceof Error ? error.message : '提交失败,请稍后再试',
|
||||
);
|
||||
setStatus(visibleClientErrorMessage(error, '提交失败,请稍后再试'));
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
|
||||
+1
-1
@@ -283,7 +283,7 @@ export function ConversationModelSelect({
|
||||
setNotice('');
|
||||
setError(
|
||||
error instanceof ModelSelectionConfigError
|
||||
? error.message
|
||||
? visibleClientErrorMessage(error)
|
||||
: '模型列表加载失败',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
|
||||
import { appUpdateCheckEnabled } from '../app/featureFlags';
|
||||
import { resolveTauriInvoke } from '../app/tauri';
|
||||
import { visibleClientErrorMessage } from './errorReporting';
|
||||
|
||||
/** 更新提示所需的元数据;清单请求、版本比较、下载、校验与安装都由官方更新插件在原生侧完成。 */
|
||||
export type AppUpdateInfo = {
|
||||
@@ -41,9 +42,7 @@ function toAppUpdateInfo(update: Update): AppUpdateInfo {
|
||||
}
|
||||
|
||||
function appUpdateFailureMessage(error: unknown): string {
|
||||
const text =
|
||||
error instanceof Error ? error.message.trim() : String(error ?? '').trim();
|
||||
return text || '更新服务未返回原因';
|
||||
return visibleClientErrorMessage(error, '更新服务未返回原因');
|
||||
}
|
||||
|
||||
async function runAppUpdateCheck(): Promise<AppUpdateCheckResult> {
|
||||
|
||||
+2
-3
@@ -30,6 +30,7 @@ import {
|
||||
DEFAULT_COMPOSER_REASONING_EFFORT,
|
||||
normalizeComposerReasoningEffort,
|
||||
} from '../../../../../features/project-workspace/composerReasoningEffort';
|
||||
import { visibleClientErrorMessage } from '../../../../../services/errorReporting';
|
||||
import type { DirectPendingTurn } from '../../conversation/directPendingTurns';
|
||||
import {
|
||||
resolveSpeechRecognitionCtor,
|
||||
@@ -271,9 +272,7 @@ export function ComposerVoiceButton({
|
||||
recognitionRef.current = null;
|
||||
setRecording(false);
|
||||
onNoticeRef.current(
|
||||
error instanceof Error && error.message
|
||||
? error.message
|
||||
: '语音输入启动失败,请稍后重试',
|
||||
visibleClientErrorMessage(error, '语音输入启动失败,请稍后重试'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user