CCSDS File Delivery Protocol (CCSDS 727.0-B-5) for space file transfer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

csvt: use Textloc.Error.t natively with Path/Sort context

Same refactor pattern as xmlt (d786b041, 067b745c):

- Dropped the custom error ADT (Missing_header, Missing_column,
Bad_value, Truncated_row, Encode_error, Invalid_utf8), error_to_string,
pp_error.
- module Error = Textloc.Error (re-exports shared infrastructure).
- module Sort = Row | Field | Header with to_string, pp, kinded,
or_kind.
- Internal helpers raise Textloc.Error.msgf/msg; try/with at boundaries.
- decode/decode_string/decode_channel/decode_file/fold_channel/fold_file
now return (_, string) result.
- Added primed variants returning (_, Error.t) result.
- Path threading: push_array for row index, push_object for column
name -- errors carry structural context.
- Added ?max_rows / ?max_cols limits on decode.
- Kept Invalid_utf8_encode of int exception.

Tests tightened to STRUCTURAL assertions (exact frames list, exact
message) instead of substring checks.

Same tightening retrofitted to xmlt's context tests -- 12 tests
now assert exact Textloc.Error.t shape (full frame list including
outer-first ordering, exact message) rather than 'contains'.

Downstream fixes: ocaml-cdm collapses its typed error ADT to
[Parse_error of string]; 38 interop test files updated from
[Alcotest.failf "%a" Csvt.pp_error e] to ["%s" e].

csvt: 60 tests pass. xmlt: 177 tests pass.

+16 -16
+1 -1
test/interop/dariol83/test.ml
··· 90 90 let load_rows () = 91 91 match Csvt.decode_file ka_codec (trace "keep_alive.csv") with 92 92 | Ok rows -> rows 93 - | Error e -> Alcotest.failf "CSV: %a" Csvt.pp_error e 93 + | Error e -> Alcotest.failf "CSV: %s" e 94 94 95 95 let decode_ka () = 96 96 let rows = load_rows () in
+15 -15
test/interop/spacepackets/test.ml
··· 198 198 let rows = 199 199 match Csvt.decode_file eof_codec (trace "eof.csv") with 200 200 | Ok rows -> rows 201 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 201 + | Error e -> Alcotest.failf "CSV decode: %s" e 202 202 in 203 203 List.iter 204 204 (fun (r : eof_row) -> ··· 249 249 let rows = 250 250 match Csvt.decode_file eof_codec (trace "eof.csv") with 251 251 | Ok rows -> rows 252 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 252 + | Error e -> Alcotest.failf "CSV decode: %s" e 253 253 in 254 254 List.iter 255 255 (fun (r : eof_row) -> ··· 374 374 let rows = 375 375 match Csvt.decode_file metadata_codec (trace "metadata.csv") with 376 376 | Ok rows -> rows 377 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 377 + | Error e -> Alcotest.failf "CSV decode: %s" e 378 378 in 379 379 List.iter 380 380 (fun (r : metadata_row) -> ··· 413 413 let rows = 414 414 match Csvt.decode_file metadata_codec (trace "metadata.csv") with 415 415 | Ok rows -> rows 416 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 416 + | Error e -> Alcotest.failf "CSV decode: %s" e 417 417 in 418 418 List.iter 419 419 (fun (r : metadata_row) -> ··· 530 530 let rows = 531 531 match Csvt.decode_file ack_codec (trace "ack.csv") with 532 532 | Ok rows -> rows 533 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 533 + | Error e -> Alcotest.failf "CSV decode: %s" e 534 534 in 535 535 List.iter 536 536 (fun (r : ack_row) -> ··· 575 575 let rows = 576 576 match Csvt.decode_file ack_codec (trace "ack.csv") with 577 577 | Ok rows -> rows 578 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 578 + | Error e -> Alcotest.failf "CSV decode: %s" e 579 579 in 580 580 List.iter 581 581 (fun (r : ack_row) -> ··· 685 685 let rows = 686 686 match Csvt.decode_file finished_codec (trace "finished.csv") with 687 687 | Ok rows -> rows 688 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 688 + | Error e -> Alcotest.failf "CSV decode: %s" e 689 689 in 690 690 List.iter 691 691 (fun (r : finished_row) -> ··· 735 735 let rows = 736 736 match Csvt.decode_file finished_codec (trace "finished.csv") with 737 737 | Ok rows -> rows 738 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 738 + | Error e -> Alcotest.failf "CSV decode: %s" e 739 739 in 740 740 List.iter 741 741 (fun (r : finished_row) -> ··· 845 845 let rows = 846 846 match Csvt.decode_file file_data_codec (trace "file_data.csv") with 847 847 | Ok rows -> rows 848 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 848 + | Error e -> Alcotest.failf "CSV decode: %s" e 849 849 in 850 850 List.iter 851 851 (fun (r : file_data_row) -> ··· 871 871 let rows = 872 872 match Csvt.decode_file file_data_codec (trace "file_data.csv") with 873 873 | Ok rows -> rows 874 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 874 + | Error e -> Alcotest.failf "CSV decode: %s" e 875 875 in 876 876 List.iter 877 877 (fun (r : file_data_row) -> ··· 992 992 let rows = 993 993 match Csvt.decode_file nak_codec (trace "nak.csv") with 994 994 | Ok rows -> rows 995 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 995 + | Error e -> Alcotest.failf "CSV decode: %s" e 996 996 in 997 997 List.iter 998 998 (fun (r : nak_row) -> ··· 1032 1032 let rows = 1033 1033 match Csvt.decode_file nak_codec (trace "nak.csv") with 1034 1034 | Ok rows -> rows 1035 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 1035 + | Error e -> Alcotest.failf "CSV decode: %s" e 1036 1036 in 1037 1037 List.iter 1038 1038 (fun (r : nak_row) -> ··· 1148 1148 Csvt.decode_file keep_alive_codec (dariol83_trace "keep_alive.csv") 1149 1149 with 1150 1150 | Ok rows -> rows 1151 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 1151 + | Error e -> Alcotest.failf "CSV decode: %s" e 1152 1152 in 1153 1153 List.iter 1154 1154 (fun (r : keep_alive_row) -> ··· 1172 1172 Csvt.decode_file keep_alive_codec (dariol83_trace "keep_alive.csv") 1173 1173 with 1174 1174 | Ok rows -> rows 1175 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 1175 + | Error e -> Alcotest.failf "CSV decode: %s" e 1176 1176 in 1177 1177 List.iter 1178 1178 (fun (r : keep_alive_row) -> ··· 1262 1262 let rows = 1263 1263 match Csvt.decode_file spacepackets_ka_codec (trace "keep_alive.csv") with 1264 1264 | Ok rows -> rows 1265 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 1265 + | Error e -> Alcotest.failf "CSV decode: %s" e 1266 1266 in 1267 1267 List.iter 1268 1268 (fun (r : spacepackets_ka_row) ->