Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field delimeter to error message when segment has less fields than required #179

Open
andrewshawcare opened this issue Feb 15, 2022 · 0 comments

Comments

@andrewshawcare
Copy link

andrewshawcare commented Feb 15, 2022

First off, thank you so much for this tool and the wonderful exception messages you provide in this tool!

They are so good, in fact, that I was almost able to construct an EDI mapping from just the exception messages alone (they do a wonderful job of hinting at what to do next).

To that end, it would be great if, when the number of fields is less than there should be for a segment, to add information about what the current field delimiter is. That way, the user can add the required amount of field delimiters to move on to a successful parse or, in the worst case, the next error message they can use to continue.

This idea would be great to add for any location in parsing where a delimiter is required.

Here's the exception in question:

throw new EDIParseException(edifactModel.getEdimap(), "Segment [" + segment.getSegcode() + "] expected to contain " + (numFieldsExpected - 1) + " fields. Actually contains " + (currentSegmentFields.length - 1) + " fields (not including segment code). Currently at segment number " + segmentReader.getCurrentSegmentNumber() + ".", segment, segmentReader.getCurrentSegmentNumber(), segmentReader.getCurrentSegmentFields());

Again, thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants