]> Creatis software - cpPlugins.git/blobdiff - lib/third_party/Pluma/Dir.cpp
More on PipelineEditor
[cpPlugins.git] / lib / third_party / Pluma / Dir.cpp
index 860220e9cca634c6607db2385903b0134ef58689..b0494b7eee64daa7a10a442df42a2edcc2690ba7 100644 (file)
@@ -30,6 +30,7 @@
 #include <Pluma/uce-dirent.h>\r
 #include <cstdio>\r
 #include <queue>\r
+#include <stdexcept>\r
 \r
 \r
 namespace pluma{\r
@@ -46,7 +47,12 @@ void listFiles(std::list<std::string>& list, const std::string& folder, const st
     dir = opendir(folder.c_str());\r
     if (dir == NULL){\r
         // could not open directory\r
-      fprintf(stderr, "Could not open \"%s\" directory.\n", folder.c_str());\r
+      // fprintf(stderr, "Could not open \"%s\" directory.\n", folder.c_str());\r
+      throw std::runtime_error(\r
+        std::string( "Could not open \"" ) +\r
+        folder +\r
+        std::string( "\" directory." )\r
+        );\r
       return;\r
     }else{\r
         // close, we'll process it next\r