From d2ba8d3be3861a3e5a3e535547dcc01ef9e826cd Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Wed, 1 Jan 2025 13:39:09 +0530 Subject: [PATCH] fix: show warning on starter template failure and continue (#960) --- app/components/chat/Chat.client.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/components/chat/Chat.client.tsx b/app/components/chat/Chat.client.tsx index aa89e8c8..135dc8fc 100644 --- a/app/components/chat/Chat.client.tsx +++ b/app/components/chat/Chat.client.tsx @@ -297,7 +297,15 @@ export const ChatImpl = memo( }); if (template !== 'blank') { - const temResp = await getTemplates(template, title); + const temResp = await getTemplates(template, title).catch((e) => { + if (e.message.includes('rate limit')) { + toast.warning('Rate limit exceeded. Skipping starter template\n Continuing with blank template'); + } else { + toast.warning('Failed to import starter template\n Continuing with blank template'); + } + + return null; + }); if (temResp) { const { assistantMessage, userMessage } = temResp;