When parsing JSON data, such as a config files or JSON messages received from remotes, Intern doesn't provide much information about errors in the data. For example, Intern currently shows an error like this for an invalid config:
Error: Invalid JSON in /Users/jason/Documents/Work/src/intern/intern/intern.json
at /Users/jason/Documents/Work/src/intern/intern/_testIntern/core/lib/common/util.js:665:19
This is what default JSON parse errors look like:
SyntaxError: Unexpected token h in JSON at position 0
at JSON.parse @ anonymous
The message emitted by Intern should indicate specifically where the problem is, and display a relevant snippet of the data. For example, if the config contained this:
When parsing JSON data, such as a config files or JSON messages received from remotes, Intern doesn't provide much information about errors in the data. For example, Intern currently shows an error like this for an invalid config:
This is what default JSON parse errors look like:
The message emitted by Intern should indicate specifically where the problem is, and display a relevant snippet of the data. For example, if the config contained this:
Intern should parse that and display a friendly error. One possibility would be
Intern could also employ syntax highlighting to change the color or font weight of the erroneous character.