fix: show warning on starter template failure and continue (#960)
Some checks are pending
Update Stable Branch / prepare-release (push) Waiting to run

This commit is contained in:
Anirban Kar 2025-01-01 13:39:09 +05:30 committed by GitHub
parent 608d9338a8
commit d2ba8d3be3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;