CodeSampleX

サンプル

shelf 1.4.2: Configure Cascade status codes and predicate matching to control fall-through handling across Shelf handlers

検証済みサンプル — pub shelf 1.4.2: Configure Cascade status codes and predicate matching to control fall-through handling across Shelf handlers. dart 3 · linux…

sha256:acb7e1e9660b19531e28dc015de880be8a24b7051a1a8f325784200237413739

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 dart linux x64 dart dart pub

検証実行環境

環境 コントラクト ステージ 実行日
dart 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · pub@1
2026-08-17
dart 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · pub@1
2026-08-18

ケース

HOW
ゴール
Configure Cascade status codes and predicate matching to control fall-through handling across Shelf handlers
パッケージ
シンボル
  • Cascade
  • Cascade.statusCodes
  • Cascade.shouldCascade
環境
dart
作成日
2026-08-17T11:53:32Z

コントラクト

  1. Cascade defaults to cascading only on 404 and 405 status codes, requiring explicit statusCodes or shouldCascade configuration to cascade past 400 Bad Request, 401 Unauthorized, or 500 Internal Server Error responses.
  2. assert default Cascade does not cascade on 400 Bad Request, 401 Unauthorized, or 500 Internal Server Error responses, halting at the first handler and returning its error response
  3. assert Cascade with custom statusCodes cascades on configured 400 and 422 status codes while halting immediately on unconfigured 403 Forbidden errors
  4. assert Cascade with shouldCascade predicate cascades on all status codes matching the predicate function
  5. assert passing both statusCodes and shouldCascade to Cascade constructor throws ArgumentError
  6. assert accessing Cascade.handler on an empty Cascade without inner handlers throws StateError

ファイル

  • NOTES.md
  • csx.json
  • pubspec.lock
  • pubspec.yaml
  • test/contract.dart

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed