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:
Dorian
2026-03-11 00:58:55 +00:00
parent 7a7cbf1da3
commit bc879b3581
16 changed files with 45 additions and 43 deletions

View File

@@ -172,8 +172,8 @@ async function loadCounts() {
sectionCounts.value[section.id] = 0
}
}
} catch {
// Silently fail
} catch (e) {
if (import.meta.env.DEV) console.warn('FileBrowser count loading failed silently', e)
}
}

View File

@@ -523,8 +523,8 @@ onMounted(async () => {
const usage = await fileBrowserClient.getUsage()
cloudStorageUsed.value = usage.totalSize
cloudFolderCount.value = usage.folderCount
} catch {
// FileBrowser may not be running — leave as loading
} catch (e) {
if (import.meta.env.DEV) console.warn('FileBrowser may not be running', e)
}
loadSystemStats()
systemStatsInterval = setInterval(loadSystemStats, 30000)
@@ -583,8 +583,8 @@ async function loadSystemStats() {
systemStats.diskTotal = res.disk_total_bytes
systemStats.diskPercent = res.disk_total_bytes > 0 ? (res.disk_used_bytes / res.disk_total_bytes) * 100 : 0
systemStats.uptimeSecs = res.uptime_secs
} catch {
// RPC unavailable — keep defaults
} catch (e) {
if (import.meta.env.DEV) console.warn('RPC unavailable — keeping defaults', e)
}
}

View File

@@ -97,8 +97,8 @@ function selectOption(option: string) {
async function proceed() {
try {
await completeOnboarding()
} catch {
// localStorage fallback in completeOnboarding ensures onboarding is marked complete
} catch (e) {
if (import.meta.env.DEV) console.warn('completeOnboarding failed, localStorage fallback ensures onboarding is marked complete', e)
}
router.push('/login').catch(() => {})
}

View File

@@ -387,8 +387,8 @@ async function loadNetworkData() {
const count = fwdRes.value.forwards?.length ?? 0
networkData.value.forwardCount = `${count} rule${count !== 1 ? 's' : ''}`
}
} catch {
// Keep N/A defaults on failure
} catch (e) {
if (import.meta.env.DEV) console.warn('Keep N/A defaults on failure', e)
} finally {
networkLoading.value = false
}

View File

@@ -684,8 +684,8 @@ async function loadTotpStatus() {
try {
const res = await rpcClient.totpStatus()
totpEnabled.value = res.enabled
} catch {
// Ignore - may not be available
} catch (e) {
if (import.meta.env.DEV) console.warn('TOTP status may not be available', e)
}
}
@@ -873,14 +873,14 @@ onMounted(async () => {
try {
const res = await rpcClient.getTorAddress()
torAddressFromRpc.value = res.tor_address ?? null
} catch {
// Ignore - tor address may not be available yet
} catch (e) {
if (import.meta.env.DEV) console.warn('Tor address may not be available yet', e)
}
}
})
async function handleLogout() {
try { await store.logout() } catch { /* proceed */ }
try { await store.logout() } catch (e) { if (import.meta.env.DEV) console.warn('Logout failed, proceeding anyway', e) }
router.push('/login').catch(() => { window.location.href = '/login' })
}
</script>

View File

@@ -1764,8 +1764,8 @@ async function revokeCredential(id: string) {
try {
await rpcClient.call({ method: 'identity.revoke-credential', params: { id } })
await loadCredentials()
} catch {
// Silent fail for revocation
} catch (e) {
if (import.meta.env.DEV) console.warn('Silent fail for revocation', e)
}
}
@@ -2016,8 +2016,8 @@ async function discoverAndAddPeers() {
if (n.onion && n.pubkey) {
try {
await rpcClient.addPeer({ onion: n.onion, pubkey: n.pubkey })
} catch {
// may already exist
} catch (e) {
if (import.meta.env.DEV) console.warn('Peer may already exist', e)
}
}
}