fix: replace all silent .catch(() => {}) with console.warn (BUG-F2)

13 silent catch handlers replaced with descriptive console.warn logging
across 6 frontend files. No silent error swallowing remains.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-12 23:06:22 +00:00
co-authored by Claude Opus 4.6
parent e5ed856df9
commit b4900cb66f
6 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ export function initCtx() {
export function getCtx(): AudioContext {
if (!ctx) initCtx()
if (ctx!.state === 'suspended') {
ctx!.resume().catch(() => {})
ctx!.resume().catch(err => console.warn('[Audio] context resume failed:', err))
}
return ctx!
}
+3 -3
View File
@@ -239,7 +239,7 @@ const _inflight = new Map<string, Promise<AudioBuffer | null>>()
function getAudioCtx(): AudioContext {
if (!_audioCtx) _audioCtx = new AudioContext()
if (_audioCtx.state === 'suspended') _audioCtx.resume().catch(() => {})
if (_audioCtx.state === 'suspended') _audioCtx.resume().catch(err => console.warn('[TTS] AudioContext resume failed:', err))
return _audioCtx
}
@@ -505,7 +505,7 @@ export function kokoroSpeak(
if (staticUrl || _workerReady) {
_generateAndCache(text, profileName).then(buf => {
if (buf) _playBuffer(buf, dest, volume)
}).catch(() => {})
}).catch(err => console.warn('[TTS] cache generation failed:', err))
return true
}
return false
@@ -514,7 +514,7 @@ export function kokoroSpeak(
/** Pre-generate audio in the worker so it's cached when needed. Fire-and-forget. */
export function kokoroPrefetch(text: string, profileName: string): void {
if (!_workerReady) return
_generateAndCache(text, profileName).catch(() => {})
_generateAndCache(text, profileName).catch(err => console.warn('[TTS] pre-cache generation failed:', err))
}
/** Await until prefetched audio is cached and ready (max 2s). Returns true if cached, false on timeout/failure. */