Skip to content

@ediocracy/parser / type aliases

type

SyntaxErrorCode ​

SyntaxErrorCode = "invalid-isa" | "misplaced-envelope-segment" | "missing-ge" | "missing-iea" | "missing-se" | "unexpected-data" | "unterminated-segment"

Defined in: packages/parser/src/reader/types.ts:88

Why readX12 could not read the text. Each value is the code of an X12SyntaxError.

  • invalid-isa: an ISA is shorter than 106 characters, lacks an element separator at a fixed position, or has delimiters that repeat or are letters or digits.
  • missing-se, missing-ge, missing-iea: a transaction set, group or interchange has no trailer before the next envelope segment or the end of the text.
  • misplaced-envelope-segment: an ST outside a group, an SE or GE with no matching header, or a segment other than TA1 directly inside an interchange or group.
  • unterminated-segment: text after the last segment terminator inside an interchange.
  • unexpected-data: text outside an interchange, an empty segment, or no ISA at all.