Adjust aphro streaming error parser

This commit is contained in:
Cohee 2023-11-08 00:25:06 +02:00
parent 2c7b954a8d
commit bda15ef007
1 changed files with 5 additions and 3 deletions

View File

@ -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);
}
}