From 47363e258f3e3f916cfe592e5de3bbe63bc16f84 Mon Sep 17 00:00:00 2001 From: toastal Date: Wed, 15 Apr 2026 01:49:13 +0000 Subject: Fix KDL.of_flow Result type and update callers - Properly type annotate KDL.of_flow to return (t, [> `ParseError]) result - Handle nested Results from Eio.Buf_read.parse_exn - Fix Manifest.read to work with new Result type - Fix nixtamal.ml error handling for Manifest and Lockfile errors All 17 tests pass.--- lib/nixtamal.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/nixtamal.ml') diff --git a/lib/nixtamal.ml b/lib/nixtamal.ml index a9435ab..9ef08e7 100644 --- a/lib/nixtamal.ml +++ b/lib/nixtamal.ml @@ -53,9 +53,7 @@ let read_manifest_and_lockfile () : (Name.Name.t list, error) result = | Ok(kdl : KDL.t) -> Manifest.document_to_t kdl |> Result.map_error (fun err -> `Parsing err) - | Error(e : KDL.error) -> - let v_errs : KDL.Valid.err list = [`ParseError e] in - Error (`Parsing v_errs) + | Error err -> Error err end in let* lockfile_opt = @@ -350,7 +348,7 @@ let upgrade ?from ?(to_ = Schema.Version.current) ?(dry_run = false) () : (unit, let* () = match Manifest.read () with | Ok _ -> Logs.info (fun m -> m "Manifest verified."); Ok () - | Error e -> Error (`Manifest (`Parsing [`ParseError e])) + | Error e -> Error (`Manifest e) in let* () = match Lockfile.read () with -- cgit v1.2.3