AX.25 Amateur Radio Link-Layer Protocol
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.

+2 -2
+2 -2
test/interop/pyax25/test.ml
··· 89 89 let rows = 90 90 match Csvt.decode_file ui_frame_codec (trace "ui_frames.csv") with 91 91 | Ok rows -> rows 92 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 92 + | Error e -> Alcotest.failf "CSV decode: %s" e 93 93 in 94 94 List.iter 95 95 (fun (r : ui_frame_row) -> ··· 118 118 let rows = 119 119 match Csvt.decode_file ext_bit_codec (trace "extension_bits.csv") with 120 120 | Ok rows -> rows 121 - | Error e -> Alcotest.failf "CSV decode: %a" Csvt.pp_error e 121 + | Error e -> Alcotest.failf "CSV decode: %s" e 122 122 in 123 123 List.iter 124 124 (fun (r : ext_bit_row) ->