Skip to content

Clear rate-limit (429) error message#107

Merged
jheller1212 merged 1 commit into
mainfrom
feat/rate-limit-error-message
Jun 24, 2026
Merged

Clear rate-limit (429) error message#107
jheller1212 merged 1 commit into
mainfrom
feat/rate-limit-error-message

Conversation

@jheller1212

Copy link
Copy Markdown
Owner

When the provider retry loop exhausts on a 429, the user saw the generic 'failed to fetch — check your API key/CORS' troubleshooting text, which is misleading. 429 is the single most likely failure when a classroom shares one API key.

Adds an explicit error.status === 429 branch: "The {provider} API is rate-limiting requests… wait, then start again. In a workshop where many people share one key this is common: lower 'messages per bot' or add a response delay." Provider-name map hoisted so 401 and 429 share it.

Verified: 429 is retried 3× then thrown as APIError{status:429}. Build ✓.

After the retry loop exhausts on a 429, the error fell into the generic
'failed to fetch / check your API key + CORS' branch, which is confusing
and wrong. A 429 is the most likely classroom failure when many
participants share one key. Add an explicit 429 branch with actionable
guidance (wait, lower messages-per-bot, add response delay). Hoist the
provider-name map so the 401 and 429 branches share it.
@jheller1212
jheller1212 merged commit 2ac58e1 into main Jun 24, 2026
@jheller1212
jheller1212 deleted the feat/rate-limit-error-message branch June 24, 2026 18:41
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for ai2aichat ready!

Name Link
🔨 Latest commit edc02b5
🔍 Latest deploy log https://app.netlify.com/projects/ai2aichat/deploys/6a3c24f04456800008f53b0a
😎 Deploy Preview https://deploy-preview-107--ai2aichat.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 97
Accessibility: 97
Best Practices: 100
SEO: 100
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant