We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2adb87a commit 97cd86fCopy full SHA for 97cd86f
1 file changed
mssql_python/pybind/ddbc_bindings.cpp
@@ -579,7 +579,12 @@ DriverHandle LoadDriverLibrary(const std::string& driverPath) {
579
#ifdef _WIN32
580
// Windows: Convert string to wide string for LoadLibraryW
581
std::wstring widePath(driverPath.begin(), driverPath.end());
582
- return LoadLibraryW(widePath.c_str());
+ HMODULE handle = LoadLibraryW(widePath.c_str());
583
+ if (!handle) {
584
+ LOG("Failed to load library: {}. Error: {}", driverPath, GetLastErrorMessage());
585
+ ThrowStdException("Failed to load library: " + driverPath);
586
+ }
587
+ return handle;
588
#else
589
// macOS/Unix: Use dlopen
590
void* handle = dlopen(driverPath.c_str(), RTLD_LAZY);
0 commit comments