jprichardson / node-jsonfile

Easily read/write JSON files.
MIT License
1.2k stars 321 forks source link

console.log(err) #53

Closed tofutim closed 7 years ago

tofutim commented 8 years ago

in your example you have console.log(err) in the callback from writeFile, but maybe it should be

if (err) throw err; ?

RyanZim commented 7 years ago

Logging the error is perfectly fine for examples. Throwing an error in an async callback is a terrible practice.