Skip to content

Commit 921cb80

Browse files
godbykrpavlik
authored andcommitted
Don't print empty error messages.
1 parent 25b58f5 commit 921cb80

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libfunctionality/LibraryHandleWin32.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ LibraryHandle RAIILoadLibrary(std::string const &name) {
7171
&LibraryFreer);
7272
if (!lib) {
7373
const auto error_msg = getLastErrorMessage();
74-
throw exceptions::CannotLoadPlugin(name, error_msg.c_str());
74+
if (error_msg.empty()) {
75+
throw exceptions::CannotLoadPlugin(name);
76+
} else {
77+
throw exceptions::CannotLoadPlugin(name, error_msg.c_str());
78+
}
7579
}
7680

7781
return lib;

0 commit comments

Comments
 (0)