zemirco / json2csv

Convert json to csv with column titles
http://zemirco.github.io/json2csv
MIT License
2.71k stars 365 forks source link

Cannot print callback err, because err is Error object, should use Error.toString() #157

Closed MapleMaster closed 6 years ago

MapleMaster commented 7 years ago

function checkParams() will throw an Error object, but console.error(err) only display {}, but no specific meaning, and it confuses the caller. I suggest use callback(err.toString()) instead of callback(err), so the caller will get the specific error information.

knownasilya commented 7 years ago

Doesn't seem to be the case:

screen shot 2016-12-15 at 11 04 55 am
knownasilya commented 7 years ago

Also the callback shouldn't be used, it will be removed in the next major version, just do var csv = json2csv(options).

juanjoDiaz commented 6 years ago

Closing this since the callback is going away on the next release.