Closed potatowave closed 6 years ago
I agree the default error message isn't very good. I added it to parts of the parser where I wasn't sure what the correct action would be, and I haven't paid enough attention to these cases yet. I'm a little busy this week, but I'll see what I can do.
I took a quick pass at adding row and column numbers to the error messages. There's a few tricky cases, so I'm not sure if they will always be accurate. I'll look more soon, but for now you can try out the current master:
npm install git+https://git@github.com/RyanMarcus/dirty-json.git
This feature is available in 0.5.4.
Awesome script.
I have a rather large chunk of I'm trying to clean. When dirty-json hits an error I get "Error: Got a :value that can't be handled" or similar, and a stack trace that isn't very helpful.
It would be really handy if I could see a decent snippet of the offending JSON so I can manually try to fix it before re-running.