From ecd9ab95ebaadc17b22023eafb89c2a0b82b63c1 Mon Sep 17 00:00:00 2001 From: Emmanuel Papin Date: Sun, 16 Nov 2014 21:50:39 +0100 Subject: [PATCH] Fix error messages when loading plugins --- src/zm_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zm_plugin.cpp b/src/zm_plugin.cpp index 334cc7a85..16adcd4fc 100644 --- a/src/zm_plugin.cpp +++ b/src/zm_plugin.cpp @@ -18,7 +18,7 @@ Plugin::Plugin(const std::string &sFilename) if(!m_hDLL) // if library hasn't been loaded successfully { - throw runtime_error(string("Could not load '") + sFilename + "'"); + throw runtime_error("Could not load '" + sFilename + "' (" + dlerror() + ")"); } // Locate the plugin's exported functions @@ -30,7 +30,7 @@ Plugin::Plugin(const std::string &sFilename) // If the functions aren't found, we're going to assume this is // a plain simple DLL and not one of our plugins if(!m_pfnGetEngineVersion || ! m_pfnRegisterPlugin) - throw runtime_error(string("'") + sFilename + "' is not a valid plugin"); + throw runtime_error("'" + sFilename + "' is not a valid plugin"); // Initialize a new DLL reference counter m_pDLLRefCount = new size_t(1); @@ -43,7 +43,7 @@ Plugin::Plugin(const std::string &sFilename) catch(...) { dlclose(m_hDLL); - throw runtime_error(string("Unknown exception while loading plugin '") + sFilename + string("'")); + throw runtime_error("Unknown exception while loading plugin '" + sFilename + "'"); } }