From e09d2127fc35d88bc94174514a2c79ad4400b9a7 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 7 Sep 2012 17:14:42 +0200 Subject: fixed error handling in module loader --- include/module/ModuleLoader.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/module/ModuleLoader.hpp b/include/module/ModuleLoader.hpp index a5416bb..d3b7d00 100755 --- a/include/module/ModuleLoader.hpp +++ b/include/module/ModuleLoader.hpp @@ -55,13 +55,13 @@ class BaseModuleLoader { m.handle = LoadLibrary( it->c_str( ) ); #endif if( !m.handle ) { + std::ostringstream ss; #ifndef _WIN32 - throw std::runtime_error( dlerror( ) ); + ss << "Module '" << *it << "' loading error: " << dlerror( ); #else - std::ostringstream ss; ss << "Module '" << *it << "' loading error: " << getLastError( ); - throw std::runtime_error( ss.str( ) ); #endif + throw std::runtime_error( ss.str( ) ); } std::string registryName = "registry_" + demangle( typeid( Interface ) ); -- cgit v1.2.3-54-g00ecf