summaryrefslogtreecommitdiff
path: root/project2/basics/preload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/basics/preload.cpp')
-rw-r--r--project2/basics/preload.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/project2/basics/preload.cpp b/project2/basics/preload.cpp
index b701d8d..104dc22 100644
--- a/project2/basics/preload.cpp
+++ b/project2/basics/preload.cpp
@@ -1,5 +1,6 @@
#include <pch.hpp>
#include <options.h>
+#include <library.h>
#include <boost/filesystem/path.hpp>
#include <map>
#include <dlfcn.h>
@@ -23,8 +24,9 @@ class Preload {
Logger()->messagebf(LOG_DEBUG, "Loaded library '%s'", librarypath.as<std::string>());
}
else {
- Logger()->messagebf(LOG_ERR, "Failed to load library '%s' (%s)", librarypath.as<std::string>(), dlerror());
- throw std::runtime_error("module load failed");
+ const char * dlerr = dlerror();
+ Logger()->messagebf(LOG_ERR, "Failed to load library '%s' (%s)", librarypath.as<std::string>(), dlerr);
+ throw LoadLibraryFailed(librarypath, dlerr);
}
libs[librarypath.as<std::string>()] = boost::shared_ptr<void>(handle, &dlclose);