More unified TTS error messages

This commit is contained in:
Cohee
2023-06-05 17:01:59 +03:00
parent fdaf58061f
commit b3ec66faa7
4 changed files with 20 additions and 18 deletions

View File

@ -118,7 +118,8 @@ class SileroTtsProvider {
}
)
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.json()}`)
toastr.error(response.statusText, 'TTS Generation Failed');
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
return response
}