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:
co-authored by
Claude Opus 4.6
parent
e5ed856df9
commit
b4900cb66f
@@ -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!
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user