Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/headers.roc
Original file line number Diff line number Diff line change
Expand Up @@ -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), ..])
Expand Down Expand Up @@ -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
}
4 changes: 3 additions & 1 deletion examples/router.roc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) ?? "<invalid utf8>"
Expand Down
Loading