From bda15ef007a347aad6598343869f8af0de58cb9b Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 8 Nov 2023 00:25:06 +0200 Subject: [PATCH] Adjust aphro streaming error parser --- public/scripts/textgen-settings.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 5fb77b93f..a4e357307 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -437,9 +437,11 @@ function tryParseStreamingError(response) { // No JSON. Do nothing. } - if (data?.error?.message) { - toastr.error(data.error.message, 'API Error'); - throw new Error(data.error.message); + const message = data?.error?.message || data?.message; + + if (message) { + toastr.error(message, 'API Error'); + throw new Error(message); } }