From 47daf8a52e79781d182902f9c4dfee2c72595719 Mon Sep 17 00:00:00 2001 From: Nicolas Bonamy Date: Wed, 1 May 2024 15:16:41 -0500 Subject: [PATCH] balance error message --- src/services/assistant.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/assistant.ts b/src/services/assistant.ts index 13ed308..fd5e0b0 100644 --- a/src/services/assistant.ts +++ b/src/services/assistant.ts @@ -180,6 +180,8 @@ export default class { if (error.name !== 'AbortError') { if (error.status === 401 || error.message.includes('401') || error.message.toLowerCase().includes('apikey')) { message.setText('You need to enter your API key in the Models tab of Settings in order to chat.') + } else if (error.status === 400 && (error.message.includes('credit') || error.message.includes('balance'))) { + message.setText('Sorry, it seems you have run out of credits. Check the balance of your LLM provider account.') } else if (message.content === '') { message.setText('Sorry, I could not generate text for that prompt.') } else {