mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
ObjLoading: Display error message on directory_iterator throwing an exception
This commit is contained in:
parent
10342a7b58
commit
b8c2557482
@ -25,8 +25,11 @@ FileAPI::IFile* SearchPathFilesystem::Open(const std::string& fileName)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SearchPathFilesystem::Find(const SearchPathSearchOptions& options, const std::function<void(const std::string&)>& callback)
|
||||
void SearchPathFilesystem::Find(const SearchPathSearchOptions& options,
|
||||
const std::function<void(const std::string&)>& callback)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (options.m_should_include_subdirectories)
|
||||
{
|
||||
std::filesystem::recursive_directory_iterator iterator(m_path);
|
||||
@ -49,4 +52,9 @@ void SearchPathFilesystem::Find(const SearchPathSearchOptions& options, const st
|
||||
callback(options.m_absolute_paths ? absolute(path).string() : path.string());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::filesystem::filesystem_error& e)
|
||||
{
|
||||
printf("Directory Iterator threw error when trying to find files: \"%s\"\n", e.what());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user