Skip to content

Commit

Permalink
Add ov::Exception wrapper (#869)
Browse files Browse the repository at this point in the history
to access its protected constructor
  • Loading branch information
t-jankowski authored Feb 7, 2024
1 parent a7293b4 commit d219e31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/nvidia_plugin/src/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
namespace ov {
namespace nvidia_gpu {
namespace {
class OVExceptionWrapper : public ov::Exception {
public:
OVExceptionWrapper(const std::string& what) : ov::Exception(what) {}
};

template <typename T>
[[gnu::cold, noreturn]] void throw_exception(const std::string& msg,
const std::experimental::source_location& location) {
Expand All @@ -20,7 +25,7 @@ template <typename T>

[[gnu::cold, noreturn]] void throw_ov_exception(const std::string& msg,
const std::experimental::source_location& location) {
throw_exception<ov::Exception>(msg, location);
throw_exception<OVExceptionWrapper>(msg, location);
}

[[gnu::cold]] void logError(const std::string& /*msg*/, const std::experimental::source_location& /*location*/) {
Expand Down

0 comments on commit d219e31

Please sign in to comment.