You are viewing a single comment's thread from:

RE: Saving Notes to a JSON file: Day Six of "The Complete Node.js Developer Course"

in #javascript8 years ago

I see what you are saying with this and I thought about it when going through this exercise. This section in the course left the code like this, but it makes sense to give some feedback if an error occurred. I think the next section will be refactoring this bit of code so that the logic can be reused by other functions. We'll see when I get there.

Sort:  

Will be interesting to see what they propose is the correct way after the refactor :)

One other thing I noticed is there is no try/catch around the writing of the file so if that fails for whatever reason it will bubble up while the read is caught. Was that intentional?