google / json5format

JSON5 (a.k.a., "JSON for Humans") formatter that preserves contextual comments

Home Page:https://crates.io/crates/json5format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve handling errors by intelligently trimming extremely long lines, when showing the location of the error

richkadel opened this issue · comments

While fixing an issue revealed by oss-fuzz, the error was related to a generated document that had 1000s of open braces on a single line.

Once the parser was able to catch the error without crashing, it generated an error message that filled my terminal scroll buffer, hiding useful debugging information.

We should be able to trim the line and still show where the syntax error was caught.