Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Inform valgrind about ucontextes [Sékou Diakite]
[simgrid.git] / src / cxx / ApplicationHandler.cxx
index 425700f..5d6d3f2 100644 (file)
@@ -85,12 +85,30 @@ namespace SimGrid
                // create the cxx process wrapper.\r
                void ApplicationHandler::ProcessFactory::createProcess() \r
                {\r
+                       Host host;\r
+                       Process* process;\r
+                       \r
                        // dynamic creation of a instance fo the process from its name (which is specified by the element function\r
                        // in the xml application file.\r
-                       Process* process = (Process*)Class::fromName(this->function);\r
+                       try\r
+                       {\r
+                               process = (Process*)Class::fromName(this->function);\r
+                       }\r
+                       catch(ClassNotFoundException e)\r
+                       {\r
+                               cerr << e.toString();   \r
+                       }\r
                        \r
-                       // retrieve the host of the process from its name\r
-                       Host host = Host::getByName(this->hostName);\r
+                       // try to retrieve the host of the process from its name\r
+                       try\r
+                       {\r
+                               host = Host::getByName(this->hostName); \r
+                       }\r
+                       catch(HostNotFoundException(this->hostName))\r
+                       {\r
+                               cerr << e.toString();\r
+                       }\r
+                               \r
                        \r
                        // build the list of the arguments of the newly created process.\r
                        int argc = xbt_dynar_length(this->args);\r