Extract data.error check
This commit is contained in:
parent
0f8a16325b
commit
77b02a8d4b
|
@ -3861,7 +3861,15 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
|
|||
if (!data) return;
|
||||
let messageChunk = '';
|
||||
|
||||
if (!data.error) {
|
||||
if (data.error) {
|
||||
generatedPromptCache = '';
|
||||
|
||||
if (data?.response) {
|
||||
toastr.error(data.response, 'API Error');
|
||||
}
|
||||
throw data?.response;
|
||||
}
|
||||
|
||||
//const getData = await response.json();
|
||||
let getMessage = extractMessageFromData(data);
|
||||
let title = extractTitleFromData(data);
|
||||
|
@ -3948,14 +3956,6 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
|
|||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
generatedPromptCache = '';
|
||||
|
||||
if (data?.response) {
|
||||
toastr.error(data.response, 'API Error');
|
||||
}
|
||||
throw data?.response;
|
||||
}
|
||||
|
||||
console.debug('/api/chats/save called by /Generate');
|
||||
await saveChatConditional();
|
||||
|
|
Loading…
Reference in New Issue