{"record":{"id":"c82651ed9176e7a9","repo":"SillyTavern/SillyTavern","slug":"http-response-status-await-response-text-c82651","errorCode":null,"errorMessage":"HTTP ${response.status}: ${await response.text()}","messagePattern":"HTTP (.+?): (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"public/scripts/extensions/tts/gsvi.js","lineNumber":57,"sourceCode":"        cha_name: '',\n        character_emotion: 'default',\n\n        speed: 1,\n\n        top_k: 6,\n        top_p: 0.85,\n        temperature: 0.75,\n        batch_size: 10,\n\n        stream: false,\n        stream_chunk_size: 100,\n    };\n\n    // Added new methods to obtain characters and emotions\n    async fetchCharacterList() {\n        const response = await fetch(this.settings.provider_endpoint + '/character_list');\n        if (!response.ok) {\n            throw new Error(`HTTP ${response.status}: ${await response.text()}`);\n        }\n        const characterList = await response.json();\n        this.characterList = characterList;\n        this.voices = Object.keys(characterList);\n    }\n\n\n    get settingsHtml() {\n        let html = `\n        <label for=\"gsvi_api_language\">Text Language</label>\n        <select id=\"gsvi_api_language\">`;\n\n        for (let language in this.languageLabels) {\n            if (this.languageLabels[language] == this.settings?.language) {\n                html += `<option value=\"${this.languageLabels[language]}\" selected=\"selected\">${language}</option>`;\n                continue;\n            }\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/SillyTavern/SillyTavern/blob/8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8/public/scripts/extensions/tts/gsvi.js#L39-L75","documentation":"Thrown by fetchCharacterList() in GSVITtsProvider when GET {provider_endpoint}/character_list returns non-OK. It reads the body as text() and embeds it in the message. The provider uses the GSVI Inference server (default http://127.0.0.1:5000).","triggerScenarios":"Calling fetchCharacterList() (during voice loading/refresh) while the GSVI server is not running on the configured port, the /character_list route is absent, or the server returns an error. Because no toastr is shown here, the failure surfaces only as a thrown error to the caller.","commonSituations":"GSVI Inference server not started, wrong provider_endpoint, the server still booting, or a GSVI version without /character_list.","solutions":["Start the GSVI Inference server (default port 5000) and verify GET {endpoint}/character_list returns JSON in a browser.","Confirm provider_endpoint in the extension settings matches the running server.","Wait for the GSVI server to finish model loading before refreshing voices.","Update or rebuild GSVI from https://github.com/X-T-E-R/GPT-SoVITS-Inference if /character_list is missing."],"exampleFix":"// before\nif (!response.ok) {\n    throw new Error(`HTTP ${response.status}: ${await response.text()}`);\n}\n\n// after\nif (!response.ok) {\n    const detail = await response.text().catch(() => '<no body>');\n    throw new Error(`GSVI /character_list HTTP ${response.status}: ${detail}`);\n}","handlingStrategy":"validation","validationCode":"const url = new URL(this.settings.provider_endpoint + '/character_list');\nif (url.hostname === 'localhost' || url.hostname === '127.0.0.1') {\n  console.warn('GSVI endpoint is loopback; ensure the server is running');\n}","typeGuard":"function isLocalhost(url) {\n  try { return ['localhost','127.0.0.1'].includes(new URL(url).hostname); }\n  catch { return false; }\n}","tryCatchPattern":"try {\n  await provider.fetchCharacterList();\n} catch (err) {\n  console.error('GSVI character list failed:', err.message);\n  toastr.error('GSVI server unreachable on ' + provider.settings.provider_endpoint);\n}","preventionTips":["Start the GSVI Inference server (port 5000) before refreshing voices.","Confirm /character_list exists in your GSVI build.","Wait until the server has loaded models."],"tags":["network","tts","http","gsvi","startup"],"backgroundTag":null,"analyzedSha":"8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8","analyzedAt":"2026-08-13T07:48:40.832Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}