From f24aa1242cd2cef0099f30b1fe8ea270f84e9c56 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Mon, 31 Oct 2022 16:33:20 -0500 Subject: [PATCH] Use error_handler if getSymbol encountered error and returns nullptr --- libsyclinterface/helper/include/dpctl_dynamic_lib_helper.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libsyclinterface/helper/include/dpctl_dynamic_lib_helper.h b/libsyclinterface/helper/include/dpctl_dynamic_lib_helper.h index b319ec6a2b..f4f5203987 100644 --- a/libsyclinterface/helper/include/dpctl_dynamic_lib_helper.h +++ b/libsyclinterface/helper/include/dpctl_dynamic_lib_helper.h @@ -38,6 +38,7 @@ #endif // __linux__ +#include "dpctl_error_handlers.h" #include namespace dpctl @@ -76,12 +77,18 @@ class DynamicLibHelper final char *error = dlerror(); if (nullptr != error) { + error_handler("Could not retrieve symbol " + std::string(symName) + + ". Error encountered: " + std::string(error), + __FILE__, __func__, __LINE__); return nullptr; } #elif defined(_WIN32) || defined(_WIN64) void *sym = (void *)GetProcAddress((HMODULE)_handle, symName); if (nullptr == sym) { + error_handler("Could not retrieve symbol " + std::string(symName) + + ".", + __FILE__, __func__, __LINE__); return nullptr; } #endif