mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 22:43:59 +01:00
error message for insufficient quota
This commit is contained in:
parent
1142e9d973
commit
98729351e0
|
@ -39,7 +39,13 @@ export const getChatCompletionStream = async (
|
|||
stream: true,
|
||||
}),
|
||||
});
|
||||
if (!response.ok) throw new Error(await response.text());
|
||||
const text = await response.text();
|
||||
if (response.status === 429 && text.includes('insufficient_quota'))
|
||||
throw new Error(
|
||||
text +
|
||||
'\nMessage from freechatgpt.chat:\nWe recommend changing your API endpoint or API key'
|
||||
);
|
||||
if (!response.ok) throw new Error(text);
|
||||
|
||||
const stream = response.body;
|
||||
return stream;
|
||||
|
|
|
@ -60,8 +60,8 @@ const ChatContent = () => {
|
|||
/>
|
||||
|
||||
{error !== '' && (
|
||||
<div className='relative bg-red-600/50 p-2 rounded-sm w-3/5 mt-3'>
|
||||
<div className='text-gray-900 dark:text-gray-300 text-sm break-words'>
|
||||
<div className='relative bg-red-600/50 p-2 rounded-sm w-3/5 mt-3 max-md:w-11/12'>
|
||||
<div className='text-gray-900 dark:text-gray-300 text-sm whitespace-pre-line'>
|
||||
{error}
|
||||
</div>
|
||||
<div
|
||||
|
|
Loading…
Reference in a new issue