Skip to content

Commit 5d33544

Browse files
author
Diptorup Deb
committed
Add missing exception handling.
1 parent 7b20dc8 commit 5d33544

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

dpctl-capi/source/dpctl_sycl_platform_interface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ __dpctl_give DPCTLSyclPlatformRef DPCTLPlatform_CreateFromSelector(
8484
PRef = wrap(P);
8585
} catch (std::bad_alloc const &ba) {
8686
std::cerr << ba.what() << '\n';
87+
} catch (runtime_error const &re) {
88+
std::cerr << re.what() << '\n';
89+
return nullptr;
8790
}
8891
}
8992
else {

dpctl-capi/source/dpctl_sycl_queue_manager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ struct QueueManager
6464
delete unwrap(CRef);
6565
} catch (std::bad_alloc const &ba) {
6666
std::cerr << ba.what() << '\n';
67+
} catch (runtime_error const &re) {
68+
std::cerr << re.what() << '\n';
6769
}
6870

6971
return qs;

0 commit comments

Comments
 (0)