HASwitchPlate / openHASP

HomeAutomation Switchplate based on lvgl for ESP32
https://www.openhasp.com
MIT License
725 stars 185 forks source link

Correct line numbering on parsing error in log #787

Open matsekberg opened 2 months ago

matsekberg commented 2 months ago

Is your feature request related to a problem? Please describe. When having parsing errors in the page jsonl it is very nice to be able to look in the serial log and find out what line the error is on. It seems as if blank lines are skipped and the line number references are wrong if the file contains blank lines.

Describe the solution you'd like When parsing, do count the blank lines also.

Describe alternatives you've considered Sorry no other options :)

Additional context Nope

fvanroie commented 1 month ago

The parsing happens object by object, so it is actually the object number instead of line number. The library doing the parsing doesn't report on blank lines, only on JSON objects encountered. I'm not sure if showing the object number instead of line number is more helpful...