jmhobbs / jsTodoTxt

JavaScript parser for todo.txt formatted text files.
https://jstodotxt.velvetcache.org
MIT License
67 stars 14 forks source link

Log parsing errors #24

Closed xuhcc closed 3 years ago

xuhcc commented 3 years ago

Log parsing errors to console instead of silently ignoring them

jmhobbs commented 3 years ago

Would it make sense to instead return a compound type from parse? One with the TodoTxtItem array, and then an array of exceptions + the lines that generated them? Obviously an API breaking change, but I think a useful one.

Perhaps this change could be for the 0.7-0.9 branches?

Thoughts?

xuhcc commented 3 years ago

Would it make sense to instead return a compound type from parse? One with the TodoTxtItem array, and then an array of exceptions + the lines that generated them? Obviously an API breaking change, but I think a useful one.

I like the idea, but I think an optional callback would work better and is backwards-compatible. I created another PR for that: #27

jmhobbs commented 3 years ago

Yes! I like that a lot better, good call.