fs.readdirSync can also throw an error.