From f1580010df0bd4ef9029678badaa3f8007e8139e Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Sat, 8 Apr 2023 22:06:32 +0800 Subject: [PATCH] improve error message --- src/api/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index 153de0f..4713496 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -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); }