Skip to content

Error() methods now include offset and have more consistent messages#9

Open
rickb777 wants to merge 1 commit into
titanous:mainfrom
rickb777:main
Open

Error() methods now include offset and have more consistent messages#9
rickb777 wants to merge 1 commit into
titanous:mainfrom
rickb777:main

Conversation

@rickb777
Copy link
Copy Markdown

@rickb777 rickb777 commented Apr 8, 2026

There are two changes in this PR.

Error messages

Error() methods now include offset information and have more consistent messages. Previously, json5 was hard to use because any error messages arising were not clear enough.

Error spec testing

json5_test.go error spec testing was enhanced so that the expected errors are compared against the actual errors. The expected messages have been updated to reflect current responses. Several new errorSpec files have been added to align with current responses so that all test inputs containing invalid JSON5 now have a corresponding errorSpec file.

What hasn't been done is to track the line and column information even though the existing errorSpec files appear to anticipate this; maybe this should be done (as a separate PR).

… error spec testing reworked to compare the expected errors against the actual errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant