diff --git a/examples/04-working-with-other-formats/src/app/router.gleam b/examples/04-working-with-other-formats/src/app/router.gleam index b90d636..b09ffd0 100644 --- a/examples/04-working-with-other-formats/src/app/router.gleam +++ b/examples/04-working-with-other-formats/src/app/router.gleam @@ -28,7 +28,7 @@ pub fn handle_request(req: Request) -> Response { // application it could be XML, protobuf, or anything else. let result = { // The GSV library is used to parse the CSV. - use rows <- result.try(gsv.to_lists(body)) + use rows <- result.try(gsv.to_lists(body) |> result.replace_error(Nil)) // Get the first row, which is the header row. use headers <- result.try(list.first(rows)) diff --git a/examples/04-working-with-other-formats/test/app_test.gleam b/examples/04-working-with-other-formats/test/app_test.gleam index 41258c8..c1a761a 100644 --- a/examples/04-working-with-other-formats/test/app_test.gleam +++ b/examples/04-working-with-other-formats/test/app_test.gleam @@ -40,5 +40,5 @@ pub fn post_successful_test() { response |> testing.string_body - |> should.equal("headers,row-count\n\"name,is-cool\",2") + |> should.equal("headers,row-count\n\"name,is-cool\",2\n") }