aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-07-30 16:08:09 +0000
committerlloyd <[email protected]>2010-07-30 16:08:09 +0000
commit28cbb01e766ed8aab988f6e3a4fd49e21a7aa258 (patch)
tree908816d9da59306431d20e2ec89ffa0806ebcc9b
parent58be96ef4a9f3e88f077d4d44748ea167284247b (diff)
If dynamic loading fails, include result of dlerror() in the exception msg
-rw-r--r--src/utils/dyn_load/dyn_load.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/dyn_load/dyn_load.cpp b/src/utils/dyn_load/dyn_load.cpp
index 621737d0c..6d359bc01 100644
--- a/src/utils/dyn_load/dyn_load.cpp
+++ b/src/utils/dyn_load/dyn_load.cpp
@@ -23,7 +23,14 @@ Dynamically_Loaded_Library::Dynamically_Loaded_Library(
lib = ::dlopen(lib_name.c_str(), RTLD_LAZY);
if(!lib)
- throw std::runtime_error("Failed to load engine " + lib_name);
+ {
+ const char* dl_err = dlerror();
+ if(!dl_err)
+ dl_err = "Unknown error";
+
+ throw std::runtime_error("Failed to load engine " + lib_name + ": " +
+ dl_err);
+ }
#endif
}