improve error message

This commit is contained in:
Jing Hua 2023-04-08 22:06:32 +08:00
parent cc82f5b29d
commit f1580010df

View file

@ -75,8 +75,8 @@ export const getChatCompletionStream = async (
if (text.includes('insufficient_quota')) {
error +=
'\nMessage from Better ChatGPT:\nWe recommend changing your API endpoint or API key';
} else {
error += '\nRate limited! Please try again later.';
} else if (response.status === 429) {
error += '\nRate limited!';
}
throw new Error(error);
}