diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0c2d6c..5c34f0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Install Zig uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # 2.2.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c28782..7491696 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ concurrency: jobs: build-bundle: name: Build package bundle - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 outputs: bundle_filename: ${{ steps.bundle.outputs.bundle_filename }} defaults: @@ -79,8 +79,8 @@ jobs: fail-fast: false matrix: os: - - ubuntu-24.04 - - ubuntu-24.04-arm + - ubuntu-26.04 + - ubuntu-26.04-arm - macos-26 - macos-26-intel - windows-2025 @@ -118,7 +118,7 @@ jobs: needs: - build-bundle - test-bundle - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 if: github.event_name == 'workflow_dispatch' permissions: contents: write diff --git a/examples/headers.roc b/examples/headers.roc index f5b40a0..1aaad66 100644 --- a/examples/headers.roc +++ b/examples/headers.roc @@ -14,7 +14,7 @@ ParsedHeaders : { x_trace_id : Str, } -parse_headers : Str -> Try(ParsedHeaders, Encoding.HttpHeader) +parse_headers : Str -> Try(ParsedHeaders, [BadHeader, MissingRequiredField(Str)]) parse_headers = |raw| Encoding.HttpHeader.parse(raw) main! : List(Str) => Try({}, [Exit(I32), StdoutErr(Str), ..]) @@ -46,13 +46,13 @@ expect { ## Header parsing reports missing required fields. expect match parse_headers("content-length: 42\r\nx-trace-id: demo-123\r\n") { - Err(Encoding.HttpHeader.MissingRequired) => Bool.True + Err(MissingRequiredField(_)) => Bool.True _ => Bool.False } ## Header parsing reports invalid field values. expect match parse_headers("accept: application/json\r\ncontent-length: nope\r\nx-trace-id: demo-123\r\n") { - Err(Encoding.HttpHeader.BadHeader) => Bool.True + Err(BadHeader) => Bool.True _ => Bool.False } diff --git a/examples/router.roc b/examples/router.roc index 9de1d7c..35841e5 100644 --- a/examples/router.roc +++ b/examples/router.roc @@ -31,7 +31,9 @@ JsonOkBody : { ok : Bool, } -WidgetRequestError : [BadBodyUtf8, BadBodyJson(Json.ParseErr)] +JsonParseError : [InvalidJson(Str), MissingRequiredField(Str)] + +WidgetRequestError : [BadBodyUtf8, BadBodyJson(JsonParseError)] body_str : Response -> Str body_str = |response| Str.from_utf8(response.body()) ?? ""