new: Merge error checks from add_files and add_files_recursive