Catch fs.readFileSync error #214
Replies: 3 comments
-
Posted at 2014-02-10 by @gfwilliams You can't at the moment - the best you could do is Perhaps it should return |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-10 by loopMasta I would prefer to get a 'undefined' instead of an empty string. This way its easier and cleaner to decide if the operation was successful and what actions to take. e.g. send 200 vs. 404. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-19 by loopMasta fs.readFileSync in v1.51 now returns undefined if the file is not found. Thanks a lot Gordon. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-02-09 by loopMasta
How can i catch an fs.readFileSync error if a requested file is not available on sd-card? Right now i get the same result for an empty file and if the file is not available.
Beta Was this translation helpful? Give feedback.
All reactions