mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Return 502 with error description when connection to remote CC API fails
If chat-completions/generate returns an error, throw the error message Reformat display of exceptions during SD prompt text generation
This commit is contained in:
@ -2057,8 +2057,9 @@ async function sendOpenAIRequest(type, messages, signal) {
|
||||
checkModerationError(data);
|
||||
|
||||
if (data.error) {
|
||||
toastr.error(data.error.message || response.statusText, t`API returned an error`);
|
||||
throw new Error(data);
|
||||
const message = data.error.message || response.statusText || t`Unknown error`;
|
||||
toastr.error(message, t`API returned an error`);
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
if (type !== 'quiet') {
|
||||
|
Reference in New Issue
Block a user