chore(ui,shared,localizations): Improve error handling when creating API keys#8056
chore(ui,shared,localizations): Improve error handling when creating API keys#8056wobsoriano wants to merge 11 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 5dfa779 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a changeset file and introduces two new localization keys and corresponding type entries: 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ui/src/components/APIKeys/APIKeys.tsx`:
- Around line 123-126: The 403 branch in APIKeys.tsx currently maps all
forbidden responses to the "usage exceeded" message; update the handler in the
block that checks err.status === 403 to inspect the backend error code (e.g.,
err?.data?.code or err?.body?.code) and only call
card.setError(t(localizationKeys('unstable__errors.api_key_usage_exceeded')))
when that code equals "token_quota_exceeded"; for other 403s call a generic
forbidden message (or a fallback like t(localizationKeys('errors.forbidden')))
and ensure err is safely null-checked before reading the code to avoid runtime
errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0715d523-4e31-4d5b-8073-facaf725b8f5
📒 Files selected for processing (5)
.changeset/cyan-elephants-roll.mdintegration/tests/machine-auth/component.test.tspackages/localizations/src/en-US.tspackages/shared/src/types/localization.tspackages/ui/src/components/APIKeys/APIKeys.tsx
Description
<APIKeys />componentChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores