Skip to content

Commit 85ec499

Browse files
Merge pull request #956 from IntelPython/use-error-handle-in-getSymbol
Use error_handler if getSymbol encountered error and returns nullptr
2 parents 2f7062a + f24aa12 commit 85ec499

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libsyclinterface/helper/include/dpctl_dynamic_lib_helper.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
#endif // __linux__
4040

41+
#include "dpctl_error_handlers.h"
4142
#include <cstdint>
4243

4344
namespace dpctl
@@ -76,12 +77,18 @@ class DynamicLibHelper final
7677
char *error = dlerror();
7778

7879
if (nullptr != error) {
80+
error_handler("Could not retrieve symbol " + std::string(symName) +
81+
". Error encountered: " + std::string(error),
82+
__FILE__, __func__, __LINE__);
7983
return nullptr;
8084
}
8185
#elif defined(_WIN32) || defined(_WIN64)
8286
void *sym = (void *)GetProcAddress((HMODULE)_handle, symName);
8387

8488
if (nullptr == sym) {
89+
error_handler("Could not retrieve symbol " + std::string(symName) +
90+
".",
91+
__FILE__, __func__, __LINE__);
8592
return nullptr;
8693
}
8794
#endif

0 commit comments

Comments
 (0)