mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Better Horde error reporting
This commit is contained in:
@ -153,6 +153,16 @@ async function generateHorde(prompt, params, signal) {
|
|||||||
const statusCheckJson = await statusCheckResponse.json();
|
const statusCheckJson = await statusCheckResponse.json();
|
||||||
console.log(statusCheckJson);
|
console.log(statusCheckJson);
|
||||||
|
|
||||||
|
if (statusCheckJson.faulted === true) {
|
||||||
|
toastr.error('Horde request faulted. Please try again.');
|
||||||
|
throw new Error(`Horde generation failed: Faulted`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statusCheckJson.is_possible === false) {
|
||||||
|
toastr.error('There are no Horde workers that are able to generate text with your request. Please change the parameters or try again later.');
|
||||||
|
throw new Error(`Horde generation failed: Unsatisfiable request`);
|
||||||
|
}
|
||||||
|
|
||||||
if (statusCheckJson.done && Array.isArray(statusCheckJson.generations) && statusCheckJson.generations.length) {
|
if (statusCheckJson.done && Array.isArray(statusCheckJson.generations) && statusCheckJson.generations.length) {
|
||||||
setGenerationProgress(100);
|
setGenerationProgress(100);
|
||||||
const generatedText = statusCheckJson.generations[0].text;
|
const generatedText = statusCheckJson.generations[0].text;
|
||||||
|
Reference in New Issue
Block a user