# 要求を断るエラー

> APIが要求を断る時に返すエラーの形と読み方を、Ledger APIの要求を断る理由と、userとpartyとpackageの管理で断る条件に分けて、章の中の図解で追います。

- URL: https://cardene.dev/diagrams/canton-api-error-codes
- 公開日: 2026-11-23
- 更新日: 2026-11-23
- トピック: Blockchain
- タグ: Canton
- 親の図解: [Canton Networkの全体像](https://cardene.dev/diagrams/canton-network.md): トランザクションの中身を関わるpartyにだけ見せるCanton Networkについて、部品ごとの役割と、1つのトランザクションが部品の間をどう流れるかを段ごとに追います。
- 子の図解: [Ledger APIの要求が断られる](https://cardene.dev/diagrams/canton-error-ledger.md): Ledger APIが要求を断る47件のエラーを、競合、引数、読む位置、存在しない資源、負荷のどれで断るかに分け、カテゴリとgrpc-statusと直し方で追います。
- 子の図解: [partyとpackageの管理で断られる](https://cardene.dev/diagrams/canton-error-admin.md): userとidentity providerとpartyとpackageを管理する要求を断る47件のエラーと、管理用packageの自動vettingの警告1件を、管理の対象ごとに、カテゴリとgrpc-statusと直し方で追います。

この章では、APIが要求を断る時に返すエラーの形と、読み方を追います。
エラーの種類と扱いは、頁「トランザクションが拒否される場面を知る」と頁「Damlの実行でコマンドが失敗する」が追っています。
この章は、それらの仕組みを題で指しながら、APIの呼び出しが断られた時に、アプリが何を読んで、どの対処を選ぶかを見ます。

まず、Ledger APIとJSON Ledger APIが、コマンドの送信と読み出しを例にした要求を断る時のエラーを、断る理由で分けて見ます。
エラーのカテゴリが、呼び出しの結果を示すステータスコードのgrpc-statusと、詳細の付け方を決める事と、競合、引数、読む位置、存在しない資源、負荷のどれで断られるかも追います。

:::details JSON
JSONは、データを文字で表すための形式で、Webのプログラムどうしのデータのやり取りに広く使われています。
:::

https://cardene.dev/diagrams/canton-error-ledger

次に、userとidentity providerとpartyとpackageを管理する要求を断るエラー47件と、管理用packageの自動vettingの警告1件を、管理の対象ごとに見ます。
古いresource versionで更新して断られる条件と、DARのuploadとvettingとtopologyの検査が断る条件も追います。

https://cardene.dev/diagrams/canton-error-admin

下の図は、この章の2つの頁が扱う物を、Participant Nodeからアプリの順に置きます。
虫眼鏡の印が付いた部品を押すと、その部品の中へ入ります。
外側へ戻る時は、右上の「戻る」か、上に並んだ名前を押します。
部品の中へ入ると、名前の並びの下にその部品を説明する頁の題が出て、押すとその頁を開きます。

```dragon
architecture アプリへ返るエラー
group Top as 要求を断るエラーを返す所 [icon: net]
  box Node as Participant Node [note: APIの要求を断る, color: slate, icon: server, link: /diagrams/canton-error-ledger]
  box App as アプリ [note: エラーを読んで対処を選ぶ, color: blue, icon: app]
end
group NodeIn as Participant Nodeの中 [color: slate, icon: server]
  box Ledger as Ledger APIの要求 [note: Ledger APIとJSON Ledger APIの要求を断る理由で分けた、47件のエラー, icon: refresh, link: /diagrams/canton-error-ledger]
  box Admin as userとidentity providerとpartyとpackageの管理 [note: 管理の対象ごとの47件のエラー, icon: server, link: /diagrams/canton-error-admin]
end

step 要求を断るエラーを返す所
  say Participant Nodeは、APIの要求を断る時に、エラーを返します。アプリは、返ったエラーを読んで、対処を選びます。対処は、エラーによって、再試行や、読み直した情報での要求の作り直しや、運用者への連絡になります。
  Node -> App: エラーを返す
  source Cantonのエラーコードの参照 [url: https://docs.canton.network/global-synchronizer/reference/error-codes]
  source Cantonのアプリ開発向けのエラーコードの参照 [url: https://docs.canton.network/appdev/reference/error-codes]
  source CantonのCommand Deduplication [url: https://docs.canton.network/appdev/deep-dives/command-deduplication]

step Participant Nodeの中
  say Ledger APIとJSON Ledger APIの要求を断るエラーは、コマンドの送信と読み出しを例に、断る理由で分けて見ます。userとidentity providerとpartyとpackageを管理する要求を断るエラーは、管理の対象ごとに見ます。
  act Ledger: 断る理由で分ける
  act Admin: 管理の対象ごとに分ける
  source Cantonのエラーコードの参照 [url: https://docs.canton.network/global-synchronizer/reference/error-codes]
  source Cantonのアプリ開発向けのエラーコードの参照 [url: https://docs.canton.network/appdev/reference/error-codes]
  source CantonのCommand Deduplication [url: https://docs.canton.network/appdev/deep-dives/command-deduplication]
  source CantonのCanton Consoleのコマンド [url: https://docs.canton.network/global-synchronizer/reference/canton-console-commands]
  source Cantonのpackageの管理 [url: https://docs.canton.network/global-synchronizer/production-operations/manage-packages]
  source CantonのIdentity Management [url: https://docs.canton.network/global-synchronizer/deployment/identity-management]
```

一番外の階では、Participant Nodeからアプリへの線が、要求を断るエラーが返る事を表します。
エラーの形と読み方の全体は、頁「Ledger APIの要求が断られる」の前半が追います。

Participant Nodeの中では、Ledger APIの要求と、userとidentity providerとpartyとpackageの管理を置きます。
Ledger APIとJSON Ledger APIの要求を断るエラーは頁「Ledger APIの要求が断られる」が、管理の要求を断るエラーは頁「partyとpackageの管理で断られる」が追います。
管理の頁の前半は、エラーの形と読み方の全体を追います。

この図では、アプリを、返ったエラーを読んで対処を選ぶ部品として置き、アプリからParticipant Nodeへ要求を送る向きの線は引かず、エラーが返る向きの線を引きます。
この図では、2つの要求を、Participant Nodeの中に置き、47件はそれぞれの頁が取り上げるエラーの数とします。
管理用packageの自動vettingの警告1件は、47件に数えません。

## 出典

https://docs.canton.network/global-synchronizer/reference/error-codes

https://docs.canton.network/appdev/reference/error-codes

https://docs.canton.network/appdev/deep-dives/command-deduplication

https://docs.canton.network/global-synchronizer/reference/canton-console-commands

https://docs.canton.network/global-synchronizer/production-operations/manage-packages

https://docs.canton.network/global-synchronizer/deployment/identity-management
