{"record":{"id":"52894cd9288bc061","repo":"SillyTavern/SillyTavern","slug":"http-response-status-response-statustext-52894c","errorCode":null,"errorMessage":"HTTP ${response.status}: ${response.statusText}","messagePattern":"HTTP (.+?): (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"public/scripts/extensions/tts/chatterbox.js","lineNumber":506,"sourceCode":"            };\n\n            // Add voice-specific parameters\n            if (isReferenceVoice) {\n                requestBody.reference_audio_filename = actualVoiceId;\n            } else {\n                requestBody.predefined_voice_id = actualVoiceId;\n            }\n\n            const response = await fetch(`${this.settings.provider_endpoint}/tts`, {\n                method: 'POST',\n                headers: {\n                    'Content-Type': 'application/json',\n                },\n                body: JSON.stringify(requestBody),\n            });\n\n            if (!response.ok) {\n                throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n            }\n\n            // Get the audio blob and play it\n            const audioBlob = await response.blob();\n            const audioUrl = URL.createObjectURL(audioBlob);\n\n            const audio = new Audio(audioUrl);\n            audio.addEventListener('ended', () => {\n                URL.revokeObjectURL(audioUrl);\n                this.updateStatus('Ready');\n            });\n\n            await audio.play();\n        } catch (error) {\n            console.error('Error previewing voice:', error);\n            this.updateStatus('Ready');\n            throw error;\n        }","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/SillyTavern/SillyTavern/blob/8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8/public/scripts/extensions/tts/chatterbox.js#L488-L524","documentation":"Thrown by the Chatterbox preview path when POST {provider_endpoint}/tts returns non-2xx during a voice preview. It builds a requestBody, posts JSON, and on failure throws status+statusText. The audio blob is only created on success, so a failure here means no preview audio plays.","triggerScenarios":"Preview requested with a voiceId the service doesn't recognize, service GPU/CPU overloaded returning 500, requestBody missing a required field the installed version expects, or service restarted mid-preview.","commonSituations":"Previewing a voice whose id no longer exists after a model swap; service out of memory with large requests; mismatch between voice list schema and generation schema across versions.","solutions":["Re-fetch the voice list so the previewed voiceId is current for the installed service version.","Check the Chatterbox service logs for the 500 cause (OOM, model error) during preview.","Confirm requestBody fields match what the installed /tts route expects.","Retry after the service finishes loading its model."],"exampleFix":"// before\nif (!response.ok) {\n    throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n}\n// after — include the response body for diagnosis (statusText is often empty)\nif (!response.ok) {\n    const detail = await response.text().catch(() => response.statusText);\n    throw new Error(`Chatterbox preview failed: HTTP ${response.status}: ${detail}`);\n}","handlingStrategy":"try-catch","validationCode":"// refresh voices so the previewed id is valid for the running service\nif (!provider.voices?.length) await provider.fetchTtsVoiceObjects();","typeGuard":null,"tryCatchPattern":"try {\n    await provider.previewTtsVoice(id);\n} catch (err) {\n    console.error('Chatterbox preview failed:', err);\n    toastr.error(String(err?.message ?? err), 'Chatterbox Preview');\n}","preventionTips":["Re-fetch voices before previewing after a service restart/model swap.","Read the body as text for diagnostics since statusText is often empty.","Match requestBody fields to the installed Chatterbox /tts schema."],"tags":["tts","chatterbox","network","preview","http-response"],"backgroundTag":null,"analyzedSha":"8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8","analyzedAt":"2026-08-13T07:48:40.832Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}