put res.size and fileNames.size into error message