Skip to content

Commit

Permalink
fix: show warning on starter template failure and continue (stackblit…
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodacus authored Jan 1, 2025
1 parent 608d933 commit d2ba8d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/components/chat/Chat.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d2ba8d3

Please sign in to comment.