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 です。
組織予算の設定 / 編集(orgBudget)
error_code | 発生条件(API) | バナー文言(JA) |
|---|---|---|
LIMIT_BELOW_USAGE | 新しい組織上限 < 今月の使用量 | この上限は、今月すでに使用したクレジットより低く設定できません。 |
ALLOCATION_EXCEEDED | 新しい組織上限 < メンバー割当合計 | この上限は、メンバーに割り当て済みのクレジット合計より低く設定できません。 |
QUOTA_ALREADY_EXISTS | すでに予算がある組織へ POST | この組織にはすでにクレジット予算があります。 |
QUOTA_NOT_FOUND | 組織 / 予算が存在しない | 組織のクレジット予算が見つかりませんでした。 |
| (その他 / なし) | 通信エラー、5xx、未マップ | 組織のクレジット予算を保存できませんでした。 |
枠の一括割り当て(assign)
error_code | 発生条件(API) | バナー文言(JA) |
|---|---|---|
ORG_BUDGET_NOT_SET | 組織予算未設定 | 組織の予算が未設定です。先にシステム管理者に設定を依頼してください。 |
ALLOCATION_EXCEEDED | 選択人数 × 上限 > 組織の残り | 選択したメンバーと上限に対して、組織の残り予算が不足しています。 |
USER_NOT_IN_ORG | 組織外メンバーを含む | 選択したメンバーの一部がこの組織に所属していません。 |
LIMIT_BELOW_USAGE | 上限 < 選択メンバーの使用量 | 上限は、選択したメンバーがすでに使用したクレジットより低く設定できません。 |
QUOTA_ALREADY_EXISTS | すでに枠があるメンバー | 選択したメンバーの一部にはすでに枠が割り当てられています。 |
| (その他 / なし) | メンバー枠を割り当てできませんでした。 |
メンバー枠の設定 / 編集(userQuota)
error_code | 発生条件(API) | バナー文言(JA) |
|---|---|---|
ORG_BUDGET_NOT_SET | 組織予算未設定 | 組織の予算が未設定です。先にシステム管理者に設定を依頼してください。 |
LIMIT_BELOW_USAGE | 新上限 < そのメンバーの使用量 | この上限は、このメンバーがすでに使用したクレジットより低く設定できません。 |
ALLOCATION_EXCEEDED | 組織の残り予算を超える | この上限は、組織の残り予算を超えています。 |
USER_NOT_IN_ORG | 組織外ユーザー | このメンバーは組織に所属していません。 |
QUOTA_ALREADY_EXISTS | すでに枠があるのに Set | このメンバーにはすでにクレジット枠があります。 |
QUOTA_NOT_FOUND | 編集対象がない | メンバーのクレジット枠が見つかりませんでした。 |
| (その他 / なし) | メンバーのクレジット枠を保存できませんでした。 |
フォームバナーにマップしないコード
チャット / 実行時制御やフォーム外操作向け: ORG_QUOTA_DISABLED、
QUOTA_DISABLED、NO_QUOTA_ASSIGNED、USER_QUOTA_EXCEEDED、ORG_REQUIRED。
有効/無効トグル、削除確認、一覧読込失敗は従来どおり トースト(またはページ内文言)です。
Changing copy
- Edit matching keys under
formErrorsin bothenandjalocale files. - Keep this doc’s tables in sync.
tests/localeParity.test.tsfails if a key exists in only one language.