]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface.cxx
index 611143e09d66ca6e170a44adb4edd73bcbc05e4b..b8bffc65b6dc4e2f1f09f0c91ae3065876853b84 100644 (file)
@@ -73,11 +73,17 @@ LoadPluginFile( const std::string& filename )
 {
   // Open library with its canonical path name
   auto canonical_fn = cpPlugins::PathHelper::CanonicalPath( filename );
+  if( canonical_fn == "" )
+    throw std::runtime_error(
+      std::string( "cpPlugins::Interface: Library \"" ) +
+      filename +
+      std::string( "\" does not exist." )
+      );
   void* hnd = Self::_DLOpen( canonical_fn );
   if( hnd == NULL )
     throw std::runtime_error(
       std::string( "cpPlugins::Interface: Could not load library \"" ) +
-      canonical_fn +
+      filename +
       std::string( "\"" )
       );