jehiah / json2csv

command line tool to convert json to csv
MIT License
801 stars 94 forks source link

better output for 'unable to parse json' #9

Closed jehiah closed 10 years ago

jehiah commented 11 years ago

When data is unable to be parsed, the bytes are output which isn't helpful when you want some human readable output of what the record was.

simonschmidt commented 10 years ago

How about outputting the bytes as a string together with the line number?

$ ./json2csv -k 'a,b' <<< '{ "a":: 1, "b": 2}'
2014/01/08 11:18:14 ERROR Decoding JSON at line 1: invalid character ':' looking for beginning of value
{ "a":: 1, "b": 2}