Skip to content

Commit 97cd86f

Browse files
Re-add error logging
Co-authored-by: Copilot <[email protected]>
1 parent 2adb87a commit 97cd86f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

mssql_python/pybind/ddbc_bindings.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,12 @@ DriverHandle LoadDriverLibrary(const std::string& driverPath) {
579579
#ifdef _WIN32
580580
// Windows: Convert string to wide string for LoadLibraryW
581581
std::wstring widePath(driverPath.begin(), driverPath.end());
582-
return LoadLibraryW(widePath.c_str());
582+
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;
583588
#else
584589
// macOS/Unix: Use dlopen
585590
void* handle = dlopen(driverPath.c_str(), RTLD_LAZY);

0 commit comments

Comments
 (0)