Credit budget form errors (error_code → UI copy)
Form modals on Credit Budgets show API failures in a red banner
(Error! / エラ ー! + message). The message is always taken from frontend
i18n, keyed by detail.error_code. Backend detail.message is not shown.
| Item | Location |
|---|---|
| Mapper | src/components/credit-budgets/formErrors.ts |
| Banner | src/components/credit-budgets/FormErrorBanner.tsx |
| Copy EN | src/i18n/locales/en/creditBudgets.json → formErrors.* |
| Copy JA | src/i18n/locales/ja/creditBudgets.json → formErrors.* |
| API codes | docs/rate-limit/rate-limit-fe-api.md (HTTP error table) |
Unknown / missing error_code → that modal’s formErrors.<context>.fallback.
Toggle enable, remove confirm, and list load failures still use toasts (or inline page text), not this banner.
English
Display shape
Error! <mapped FE sentence>
Set / Edit organization budget (orgBudget)
error_code | When (API) | Banner text (EN) |
|---|---|---|
LIMIT_BELOW_USAGE | New org limit < org used this month | This limit cannot be lower than credits already used this month. |
ALLOCATION_EXCEEDED | New org limit < sum of member limits | This limit cannot be lower than credits already allocated to members. |
QUOTA_ALREADY_EXISTS | POST when org already has a budget | This organization already has a credit budget. |
QUOTA_NOT_FOUND | Org / budget missing | Organization budget was not found. |
| (other / none) | Network, 5xx, unmapped code | Could not save the organization budget. |
Assign quotas (assign)
error_code | When (API) | Banner text (EN) |
|---|---|---|
ORG_BUDGET_NOT_SET | Org has no SysAdmin budget | Organization budget is not set. Ask a system admin to set it first. |
ALLOCATION_EXCEEDED | Selected × limit > org remaining | Not enough organization budget left for the selected members and limit. |
USER_NOT_IN_ORG | One or more users not in org | One or more selected members are not in this organization. |
LIMIT_BELOW_USAGE | Limit < a selected member’s used | Limit cannot be lower than credits a selected member has already used. |
QUOTA_ALREADY_EXISTS | Member already has a quota row | One or more selected members already have a quota. |
| (other / none) | Could not assign member quotas. |
Set / Edit member quota (userQuota)
error_code | When (API) | Banner text (EN) |
|---|---|---|
ORG_BUDGET_NOT_SET | Org has no SysAdmin budget | Organization budget is not set. Ask a system admin to set it first. |
LIMIT_BELOW_USAGE | New limit < that member’s used | This limit cannot be lower than credits this member has already used. |
ALLOCATION_EXCEEDED | New limit would exceed org remaining | This limit exceeds the organization budget remaining. |
USER_NOT_IN_ORG | User not in org | This member is not in the organization. |
QUOTA_ALREADY_EXISTS | Set when quota already exists | This member already has a credit quota. |
QUOTA_NOT_FOUND | Edit target missing | Member quota was not found. |
| (other / none) | Could not save the member quota. |
Not mapped in form banners
These codes belong to chat / enforcement or non-form actions: ORG_QUOTA_DISABLED,
QUOTA_DISABLED, NO_QUOTA_ASSIGNED, USER_QUOTA_EXCEEDED, ORG_REQUIRED.
日本語
表示形式
エラー! <フロントエンドが決めた文言>
API の detail.message はそのまま出しません。error_code から
creditBudgets.formErrors.* を引きます。未知のコードやコードなしは各モーダルの
fallback です。