diff --git a/src/xenia/vfs/devices/host_path_entry.cc b/src/xenia/vfs/devices/host_path_entry.cc index 04c9e2dc8..dba726c2a 100644 --- a/src/xenia/vfs/devices/host_path_entry.cc +++ b/src/xenia/vfs/devices/host_path_entry.cc @@ -97,13 +97,14 @@ std::unique_ptr HostPathEntry::CreateEntryInternal( bool HostPathEntry::DeleteEntryInternal(Entry* entry) { auto full_path = host_path_ / xe::to_path(entry->name()); + std::error_code ec; // avoid exception on remove/remove_all failure if (entry->attributes() & kFileAttributeDirectory) { // Delete entire directory and contents. - return std::filesystem::remove_all(full_path); + return std::filesystem::remove_all(full_path, ec); } else { // Delete file. return !std::filesystem::is_directory(full_path) && - std::filesystem::remove(full_path); + std::filesystem::remove(full_path, ec); } }