fix(ui): 空catch块添加日志 + ErrorBoundary覆盖高风险组件
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
空catch块修复 (12处, 6文件): - ModelsAPI: 4处 localStorage 配置读写添加 console.warn - VikingPanel: 2处 viking 操作添加日志 - Workspace/MCPServices/SaaSStatus/TOTPSettings: 各1-3处 ErrorBoundary新增覆盖: - ChatArea: 两种UI模式均包裹(防白屏) - RightPanel: 两种UI模式均包裹 - AuditLogsPanel/HeartbeatConfig/VikingPanel: 设置页包裹
This commit is contained in:
@@ -80,8 +80,8 @@ function loadEmbeddingConfigBase(): Omit<EmbeddingConfig, 'apiKey'> & { apiKey:
|
||||
const parsed = JSON.parse(stored);
|
||||
return { ...parsed, apiKey: '' };
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
} catch (e) {
|
||||
console.warn('[ModelsAPI] Failed to load embedding config:', e);
|
||||
}
|
||||
return {
|
||||
provider: 'local',
|
||||
@@ -99,8 +99,8 @@ function loadEmbeddingConfigBase(): Omit<EmbeddingConfig, 'apiKey'> & { apiKey:
|
||||
function saveEmbeddingConfigBase(config: Omit<EmbeddingConfig, 'apiKey'>): void {
|
||||
try {
|
||||
localStorage.setItem(EMBEDDING_STORAGE_KEY, JSON.stringify(config));
|
||||
} catch {
|
||||
// ignore
|
||||
} catch (e) {
|
||||
console.warn('[ModelsAPI] Failed to save embedding config:', e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,8 +129,8 @@ function loadCustomModelsBase(): CustomModel[] {
|
||||
if (stored) {
|
||||
return JSON.parse(stored);
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
} catch (e) {
|
||||
console.warn('[ModelsAPI] Failed to load model config:', e);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
@@ -143,8 +143,8 @@ function saveCustomModelsBase(models: CustomModel[]): void {
|
||||
return rest;
|
||||
});
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(sanitized));
|
||||
} catch {
|
||||
// ignore
|
||||
} catch (e) {
|
||||
console.warn('[ModelsAPI] Failed to save model config:', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user