Skip to content

Commit

Permalink
Merge pull request oneapi-src#792 from pbalcer/uncaught-e-fs
Browse files Browse the repository at this point in the history
[loader] fix potential uncaught exception
  • Loading branch information
igchor committed Aug 9, 2023
2 parents 736cfd2 + 5ee78f4 commit 09cb31a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/loader/ur_adapter_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ class AdapterRegistry {
if (forceLoadedAdaptersOpt.has_value()) {
for (const auto &s : forceLoadedAdaptersOpt.value()) {
auto path = fs::path(s);
if (fs::exists(path)) {
bool exists = false;
try {
exists = fs::exists(path);
} catch (std::exception &e) {
logger::error(e.what());
}

if (exists) {
adaptersLoadPaths.emplace_back(std::vector{path});
} else {
logger::warning(
Expand Down

0 comments on commit 09cb31a

Please sign in to comment.