fix: add dev-mode warnings to all 24 silent catch blocks
Every empty/comment-only catch block now logs a descriptive warning in dev mode via `if (import.meta.env.DEV) console.warn(...)`. Covers 15 files across views, stores, components, and utils. Zero silent catches remaining. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
7a7cbf1da3
commit
bc879b3581
@@ -95,8 +95,8 @@ export const useAIPermissionsStore = defineStore('aiPermissions', () => {
|
||||
const parsed = JSON.parse(stored) as AIContextCategory[]
|
||||
return new Set(parsed.filter(c => AI_PERMISSION_CATEGORIES.some(cat => cat.id === c)))
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
} catch (e) {
|
||||
if (import.meta.env.DEV) console.warn('Failed to load AI permissions from storage', e)
|
||||
}
|
||||
return new Set()
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ export const useSpotlightStore = defineStore('spotlight', () => {
|
||||
recentItems.value = [withTimestamp, ...filtered].slice(0, MAX_RECENT_ITEMS)
|
||||
try {
|
||||
localStorage.setItem(RECENT_ITEMS_KEY, JSON.stringify(recentItems.value))
|
||||
} catch {
|
||||
// Ignore storage errors
|
||||
} catch (e) {
|
||||
if (import.meta.env.DEV) console.warn('Failed to save recent items to storage', e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ export const useWeb5BadgeStore = defineStore('web5Badge', () => {
|
||||
try {
|
||||
const res = await rpcClient.call<{ requests: Array<{ id: string }> }>({ method: 'network.list-requests' })
|
||||
pendingRequestCount.value = res.requests?.length ?? 0
|
||||
} catch {
|
||||
// ignore — badge is best-effort
|
||||
} catch (e) {
|
||||
if (import.meta.env.DEV) console.warn('Badge refresh failed — best-effort', e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user