catching exceptions that fs.statSync() may cause