Does it make practical value to put fs.existsSync inside try...catch?
Is it possible that it will cause an error? How can this happen and which error would it be?
The reason I'm asking is because I'm trying avoid nested try...catch if possible.
Looking at the (current) implementation, it doesn't make sense to wrap it with try...catch:
fs.existsSync = function(path) {
try {
handleError((path = getPathFromURL(path)));
nullCheck(path);
binding.stat(pathModule._makeLong(path));
return true;
} catch (e) {
return false;
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With