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')) { if (text.includes('insufficient_quota')) {
error += error +=
'\nMessage from Better ChatGPT:\nWe recommend changing your API endpoint or API key'; '\nMessage from Better ChatGPT:\nWe recommend changing your API endpoint or API key';
} else { } else if (response.status === 429) {
error += '\nRate limited! Please try again later.'; error += '\nRate limited!';
} }
throw new Error(error); throw new Error(error);
} }