Improve Scale JWT error handling

This commit is contained in:
Cohee
2024-04-16 18:59:01 +03:00
parent 3dcea41c4e
commit 8546490bcc
2 changed files with 48 additions and 18 deletions

View File

@ -1594,6 +1594,11 @@ async function sendAltScaleRequest(messages, logit_bias, signal, type) {
signal: signal,
});
if (!response.ok) {
tryParseStreamingError(response, await response.text());
throw new Error('Scale response does not indicate success.');
}
const data = await response.json();
return data.output;
}