Add more clear error messages to TTS

This commit is contained in:
Cohee
2023-06-05 16:57:58 +03:00
parent f8c5b17e57
commit 46bdee83bc
2 changed files with 3 additions and 3 deletions

View File

@ -127,14 +127,14 @@ class EdgeTtsProvider {
}
)
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.json()}`)
toastr.error(response.statusText);
throw new Error(`HTTP ${response.status}`)
}
return response
}
}
function throwIfModuleMissing() {
if (!modules.includes('edge-tts')) {
toastr.error(`Edge TTS module not loaded. Add edge-tts to enable-modules and restart the Extras API.`)
throw new Error(`Edge TTS module not loaded.`)
}