fix: show warning on starter template failure and continue (#960)
Browse files
app/components/chat/Chat.client.tsx
CHANGED
@@ -297,7 +297,15 @@ export const ChatImpl = memo(
|
|
297 |
});
|
298 |
|
299 |
if (template !== 'blank') {
|
300 |
-
const temResp = await getTemplates(template, title)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
|
302 |
if (temResp) {
|
303 |
const { assistantMessage, userMessage } = temResp;
|
|
|
297 |
});
|
298 |
|
299 |
if (template !== 'blank') {
|
300 |
+
const temResp = await getTemplates(template, title).catch((e) => {
|
301 |
+
if (e.message.includes('rate limit')) {
|
302 |
+
toast.warning('Rate limit exceeded. Skipping starter template\n Continuing with blank template');
|
303 |
+
} else {
|
304 |
+
toast.warning('Failed to import starter template\n Continuing with blank template');
|
305 |
+
}
|
306 |
+
|
307 |
+
return null;
|
308 |
+
});
|
309 |
|
310 |
if (temResp) {
|
311 |
const { assistantMessage, userMessage } = temResp;
|