castle icon indicating copy to clipboard operation
castle copied to clipboard

Line number on error messages?

Open FuzzySlipper opened this issue 6 years ago • 3 comments

I've had random bugs with data changes so that the file becomes unreadable. Not a big deal because I can hop into the JSON and fix it, but sometimes finding the actual error (typically an extra comma or something) can be tedious on a large file. Would it be possible for the program to say which line it was on when it hits an 'error reading X' error?

FuzzySlipper avatar Oct 24 '18 21:10 FuzzySlipper

Did these errors happen when using CDB ? It should not really be allowed to corrupt the data.

ncannasse avatar Oct 25 '18 12:10 ncannasse

I've definitely broken it with manual JSON editing that was my fault but I'd just like it easier to find my own typos. I've also had it while using CDB. Probably the most consistent way to get it to wig out is reorder sheets too quickly.

FuzzySlipper avatar Nov 12 '18 01:11 FuzzySlipper

Sadly, I don't think the default JS JSON parser gives a precise error line. We could use a more advanced parser such as HScript on error, but this would require an extra library. Not sure it's worth it for now.

ncannasse avatar Nov 12 '18 10:11 ncannasse